Section: 23.5.1 [tuple.general] Status: NAD Submitter: Nevin Liber Opened: 2014-10-10 Last modified: 2017-06-10
Priority: Not Prioritized
View all other issues in [tuple.general].
View all issues with NAD status.
In 23.5.1 [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.
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.
[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.
[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
This wording is relative to N3936.
Change 23.5.1 [tuple.general] p2, header <tuple> synopsis, as indicated
[…] // 22.214.171.124, tuple helper classes: template <class T> class tuple_size;
Change 126.96.36.199 [tuple.helper] as indicated
[…] template <class T> struct tuple_size ; […]