This is an unofficial snapshot of the ISO/IEC JTC1 SC22 WG21 Core Issues List revision 115e. See http://www.open-std.org/jtc1/sc22/wg21/ for the official list.

2024-11-11


2340. Reference collapsing and structured bindings

Section: 9.6  [dcl.struct.bind]     Status: open     Submitter: Daveed Vandevoorde     Date: 2017-03-29

According to 9.6 [dcl.struct.bind] paragraph 3,

Given the type Ti designated by std::tuple_element<i, E>::type, each vi is a variable of type “reference to Ti” initialized with the initializer, where the reference is an lvalue reference if the initializer is an lvalue and an rvalue reference otherwise; the referenced type is Ti.

If Ti is already a reference type, should this do reference collapsing? Presumably yes, but reference collapsing is specified in terms of a typedef-name or decltype-specifier, which are not used in this description.

See also issue 2313.