Explain decltype!
Show answer and explanation
For an unparenthesized name or member-access expression, decltype generally reports the declared type of the named entity; structured bindings and constant template parameters have special rules. For other expressions of type T, it reflects value category: lvalue gives T&, xvalue gives T&&, and prvalue gives T. Thus decltype(object.member) gives the member's declared type, while decltype((object.member)) gives an lvalue reference when object is an lvalue.
For an unparenthesized name or member-access expression, decltype generally reports the declared type of the named entity; structured bindings and constant template parameters have special rules. For other expressions of type T, it reflects value category: lvalue gives T&, xvalue gives T&&, and prvalue gives T. Thus decltype(object.member) gives the member's declared type, while decltype((object.member)) gives an lvalue reference when object is an lvalue.
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.