2 ms·
To be fair, the Python syntax is just: a, b = b, a The "std::tie(b, a) = std::make_tuple(a, b)" is an attempt to replicate the Python style in C++... which, I
by tobinfricke 6y ago
To be fair, the Python syntax is just:
a, b = b, a
The "std::tie(b, a) = std::make_tuple(a, b)" is an attempt to replicate the Python style in C++... which, I agree, is certainly not clear, and, unlike using the "swap" algorithm, it's also unclear whether it will result in efficient code.