This page is a snapshot from the LWG issues list, see the Library Active Issues List for more information and the meaning of C++11 status.

### 1114. Type traits underspecified

Section: 20.15 [meta] Status: C++11 Submitter: Daniel Krügler Opened: 2009-05-12 Last modified: 2016-01-28

Priority: Not Prioritized

View other active issues in [meta].

View all other issues in [meta].

View all issues with C++11 status.

Discussion:

Related to 975 and 1023.

The current wording in 20.15.2 [meta.rqmts] is still unclear concerning it's requirements on the type traits classes regarding ambiguities. Specifically it's unclear

- if a predicate trait (20.15.5 [meta.unary], 20.15.7 [meta.rel]) could derive from both `true_type`/`false_type`.
- if any of the type traits (20.15.2 [meta.rqmts], 20.15.5 [meta.unary], 20.15.7 [meta.rel]) could ambiguously derive from the same specified result type.
- if any of the type traits (20.15.2 [meta.rqmts], 20.15.5 [meta.unary], 20.15.7 [meta.rel]) could derive from other `integral_constant` types making the contained names ambiguous
- if any of the type traits (20.15.2 [meta.rqmts], 20.15.5 [meta.unary], 20.15.7 [meta.rel]) could have other base classes that contain members hiding the name of the result type members or make the contained member names ambiguous.

[ Batavia (2009-05): ]

> Alisdair would prefer to factor some of the repeated text, but modulo a corner case or two, he believes the proposed wording is otherwise substantially correct.

> Move to Open.

[ 2009-10 post-Santa Cruz: ]

> Move to Tentatively Ready.

Proposed resolution:

[ The usage of the notion of a BaseCharacteristic below might be useful in other places - e.g. to define the base class relation in 20.14.6 [refwrap], 20.14.16 [func.memfn], or 20.14.17.3 [func.wrap.func]. In this case it's definition should probably be moved to Clause 17 ]

1. Change 20.15.2 [meta.rqmts] p.1 as indicated:

   > [..] It shall be `DefaultConstructible`, `CopyConstructible`, and publicly and unambiguously derived, directly or indirectly, from its BaseCharacteristic, which is a specialization of the template `integral_constant` (20.6.3), with the arguments to the template `integral_constant` determined by the requirements for the particular property being described. The member names of the BaseCharacteristic shall be unhidden and unambiguously available in the UnaryTypeTrait.

2. Change 20.15.2 [meta.rqmts] p.2 as indicated:

   > [..] It shall be `DefaultConstructible`, `CopyConstructible`, and publicly and unambiguously derived, directly or indirectly, from an instance its BaseCharacteristic, which is a specialization of the template `integral_constant` (20.6.3), with the arguments to the template `integral_constant` determined by the requirements for the particular relationship being described. The member names of the BaseCharacteristic shall be unhidden and unambiguously available in the BinaryTypeTrait.

3. Change 20.15.5 [meta.unary] p.2 as indicated:

   > Each of these templates shall be a UnaryTypeTrait (20.6.1), publicly derived directly or indirectly from `true_type` if the corresponding condition is true, otherwise from `false_type` where its BaseCharacteristic shall be `true_type` if the corresponding condition is true, otherwise `false_type`.

4. Change 20.15.7 [meta.rel] p.2 as indicated:

   > Each of these templates shall be a BinaryTypeTrait (20.6.1), publicly derived directly or indirectly from `true_type` if the corresponding condition is true, otherwise from `false_type` where its BaseCharacteristic shall be `true_type` if the corresponding condition is true, otherwise `false_type`.