How do structured bindings bind arrays, tuple-like types, and class members, and when are the bindings references?
Show answer and explanation
A structured-binding declaration first creates a hidden entity and then binds names using one of three protocols: array elements, tuple-like customization through tuple_size/get, or eligible non-static data members. auto [..] initializes its own hidden object, while auto& or const auto& binds that entity to the initializer; the declared names behave as lvalues referring to the selected subobjects even though decltype(name) follows special rules. Copy cost, constness, and lifetime therefore depend on the declaration form, and tuple-like customization must keep get and tuple metadata consistent.
A structured-binding declaration first creates a hidden entity and then binds names using one of three protocols: array elements, tuple-like customization through tuple_size/get, or eligible non-static data members. auto [..] initializes its own hidden object, while auto& or const auto& binds that entity to the initializer; the declared names behave as lvalues referring to the selected subobjects even though decltype(name) follows special rules. Copy cost, constness, and lifetime therefore depend on the declaration form, and tuple-like customization must keep get and tuple metadata consistent.
Connect the conclusion directly to the type, lifetime, ownership, overload-resolution rule, or library contract present in the question. State implementation dependence or a violated precondition explicitly instead of merely guessing output.