Structured bindings are a feature in C++17 (previously called C++1z) that allow for declaring multiple variables initialized from a tuple or struct.
Structured bindings are a feature in C++17 (previously called C++1z) that allow for declaring multiple variables initialized from a tuple or struct.
Given a function defined:
tuple<T1,T2,T3>
f(/*...*/) {
/*...*/
return {a,b,c};
}
It can be used to initialize three local variables like so:
auto [x, y, z] = f()
The original proposal is available as P0144 on the C++ Standards Committee website.