Title
Unspecialized std::tuple_size should be defined
Status
nad
Section
[tuple.general]
Submitter
Nevin Liber

Created on 2014-10-10.00:00:00 last changed 82 months ago

Messages

Date: 2017-06-05.15:41:21

Proposed resolution:

This wording is relative to N3936.

  1. Change [tuple.general] p2, header <tuple> synopsis, as indicated

    […]
    // 20.4.2.5, tuple helper classes:
    template <class T> class tuple_size; // undefined
    […]
    
  2. Change [tuple.helper] as indicated

    […]
    template <class T> struct tuple_size { };
    […]
    
Date: 2017-06-02.00:00:00

[ 2017-06-02 Issues Telecon ]

It's unclear what benefit this change would have, but making it complete would have very undesirable interactions with structured bindings. The current Core wording for structured bindings depends on tuple_size being an incomplete type.

Resolve as NAD

Date: 2017-06-05.15:41:21

[ 2017-02 in Kona, LEWG recommends NAD ]

We believe there are other ways to achieve the same results (at least for all of the use cases we could see). We invite Nevin to provide more details / motivations if this is necessary, not just helpful in a limited number of cases. If the dr is raised, variant_size should be considered for the same change as well.

Date: 2014-11-04.10:07:55

[ 2014-11 Urbana ]

Moved to LEWG 42.

This request goes beyond simply making an API respond well to SFINAE, but coupling that with an implication for other tuple APIs. The proper place for such design discussions is LEWG.

Date: 2014-10-10.00:00:00

In [tuple.general] paragraph 2, the unspecialized std::tuple_size is undefined. It would be a lot more useful with SFINAE if it were defined as an empty struct; that way, it can be used with enable_if for determining whether or not it is valid to use tuple_size, tuple_element and get on the corresponding data structure.

History
Date User Action Args
2017-06-05 15:41:21adminsetmessages: + msg9224
2017-06-05 15:41:21adminsetmessages: + msg9223
2017-06-05 15:41:21adminsetstatus: lewg -> nad
2014-11-04 10:07:55adminsetstatus: new -> lewg
2014-11-03 20:00:17adminsetmessages: + msg7165
2014-10-10 19:52:16adminsetmessages: + msg7151
2014-10-10 00:00:00admincreate