Is there any way of doing parallel assignment in C++? Currently, the below compiles (with warnings)
#include <iostream>
int main() {
int a = 4;
int b = 5;
a, b = b, a;
std::cout << "a: " << a << endl
<< "b: " << b << endl;
return 0;
}
and prints:
a: 4
b: 5
What I'd like it to print ... if it weren't obvious, is:
a: 5
b: 4
As in, say, ruby, or python.