I\'d like to create a macro which unpacks a pair into two local variables. I\'d like to not create a copy of the pair if it\'s just a variable, which this would accomplish:<
You don't need a macro for this.
auto p = std::make_pair(2, 3);
int x, y;
std::tie(x, y) = p;
If you want references to existing members of a pair:
auto p = std::make_pair(2, 3);
auto& x = p.first;
auto& y = p.second;
That's it.
Now you can move on to something more challenging/interesting/important.