Title
tuple_size requirements for structured binding
Status
cd5
Section
9.6 [dcl.struct.bind]
Submitter
Stephan T. Lavavej

Created on 2018-09-19.00:00:00 last changed 47 months ago

Messages

Date: 2018-12-15.00:00:00

Proposed resolution (December, 2018):

Change 9.5 [dcl.fct.def] paragraph 4 as follows:

Otherwise, if the qualified-id std::tuple_size<E> names a complete class type with a member value, 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...
Date: 2019-02-15.00:00:00

[Accepted as a DR at the February, 2019 meeting.]

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

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.

However, the common idiom in the library is that SFINAE tests the presence or absence of a value member rather than the completeness of the class; see 22.4.7 [tuple.helper] paragraph 4. The core language requirement should be changed to match the common library practice.

History
Date User Action Args
2020-12-15 00:00:00adminsetmessages: + msg6398
2018-09-19 00:00:00admincreate