|
|
|
|
|
by squidbidness
3636 days ago
|
|
To clarify a question raised in this write-up: "auto [a , b , c] = getvalues(); "The braces are needed, getvalues returns a tuple. std::pair is not mentioned in the proposal, so its unclear if this works with pair, which is returned by the STL in some insert methods." Destructured bindings will work with arrays; plain aggregate structs; and any class that offers a specialization of std::get<>(), so both std::tuple and std::pair are supported as a consequence. (C++11 added std::get<>() for std::pair). |
|