Inconsistent tuple_size specialization

Given the explicit specialization for both tuple_size and tuple_element for some template, I realized that ยง14.5.1 / 4, which states

In a re-declaration, partial specialization, explicit specialization or explicit creation of a class template, the class key must agree in kind with the declaration of the original template template (7.1.6.3).

apparently violated by the standard itself:

enter image description here

Is something missing for me (for example, the standard indicates that the keys of the class are "only exposition" and will agree in the actual implementation)?

+4
source share
2 answers

Bo Persson has now deleted the answer, that's right. The paragraph ([temp.class] / p4) that you quote refers to ยง7.1.6.3 [dcl.type.elab] for the definition of "agree in kind", which in turn says (p3, emphasis mine)

The keyword of the class or enum present in the specified type specifier must be consistent in kind with the declaration to which the name in the specifier of the specified type refers. This rule also applies to the form of a specified type specifier, which declares a class-name or a class of a friend, since it can be construed as referring to the class definition. Thus, in any specifier of the specified type, the enum keyword should be used to indicate enumeration (7.2), the union class key should be used to refer to the union (section 9), and either the class class or struct class-key should be used to indicate the class ( Section 9) declared using class or struct class-key .

The code is valid if it is incompatible.

+4
source

It looks like an editorial bug for me. Try to open the problem here:

https://github.com/cplusplus/draft/issues

If you are adventurous, try resolving it with a pull request. :-)

+1
source

All Articles