6 ms·
C++17 adds tuple unpacking under the name "structured bindings" auto [a, b] = function_returning_pair(); Of course, tuple unpacking was already possible b
by lorenzhs 10y ago
C++17 adds tuple unpacking under the name "structured bindings"
auto [a, b] = function_returning_pair();
Of course, tuple unpacking was already possible before if the variables were already declared:
int a, b;
std::tie(a, b) = function_returning_pair();