Title
Underspecified template arguments in structured bindings
Status
cd5
Section
9.6 [dcl.struct.bind]
Submitter
Daveed Vandevoorde

Created on 2017-03-29.00:00:00 last changed 48 months ago

Messages

Date: 2021-02-24.00:00:00

Proposed resolution, March, 2018:

Change 9.6 [dcl.struct.bind] paragraph 3 as follows:

Otherwise, if the qualified-id std::tuple_size<E> names a complete type, the expression std::tuple_size<E>::value shall be a well-formed integral constant expression and the number of elements in the identifier-list shall be equal to the value of that expression. Let i be an index prvalue of type std::size_t corresponding to vi. The unqualified-id get is looked up in the scope of E by class member access lookup (_N4868_.6.5.6 [basic.lookup.classref]), and if that finds at least one declaration, the initializer is e.get<i>(). Otherwise, the initializer is get<i>(e), where get is looked up in the associated namespaces (6.5.4 [basic.lookup.argdep]). In either case, get<i> is interpreted as a template-id. [Note: Ordinary unqualified lookup...
Date: 2018-06-15.00:00:00

[Accepted as a DR at the June, 2018 (Rapperswil) meeting.]

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

Otherwise, if the qualified-id std::tuple_size<E> names a complete type, the expression std::tuple_size<E>::value shall be a well-formed integral constant expression and the number of elements in the identifier-list shall be equal to the value of that expression. The unqualified-id get is looked up in the scope of E by class member access lookup (_N4868_.6.5.6 [basic.lookup.classref]), and if that finds at least one declaration, the initializer is e.get<i>(). Otherwise, the initializer is get<i>(e), where get is looked up in the associated namespaces (6.5.4 [basic.lookup.argdep]). In either case, get<i> is interpreted as a template-id.

It is not clear what i is in this description, and in particular, its type is not specified.

History
Date User Action Args
2020-12-15 00:00:00adminsetstatus: ready -> cd5
2018-04-11 00:00:00adminsetmessages: + msg6176
2018-04-11 00:00:00adminsetstatus: drafting -> ready
2017-03-29 00:00:00admincreate