Advanced
C++
Q97 / 100
What is Structured Binding Declarations interaction with custom types (C++17)?
Correct! Well done.
Incorrect.
The correct answer is B) Any type can support structured bindings by specializing std::tuple_size, std::tuple_element, and providing get<N>
B
Correct Answer
Any type can support structured bindings by specializing std::tuple_size, std::tuple_element, and providing get<N>
Explanation
Specializing tuple_size<MyType>, tuple_element<N, MyType>, and providing get<N>(MyType&) enables auto [a, b] = myValue for custom types.
Progress
97/100