This page is a snapshot from the LWG issues list, see the Library Active Issues List for more information and the meaning of TS status.
BaseCharacteristic, which is defined only for
UnaryTypeTraits and BinaryTypeTraitsSection: 3.3.3 [fund.ts.v2::meta.logical] Status: TS Submitter: Tim Song Opened: 2015-12-10 Last modified: 2020-09-06
Priority: 2
View all other issues in [fund.ts.v2::meta.logical].
View all issues with TS status.
Discussion:
Addresses: fund.ts.v2
The specification of conjunction and disjunction uses the term BaseCharacteristic, which
is problematic in several ways:
That term is defined in 21.3.2 [meta.rqmts], but only for UnaryTypeTraits and BinaryTypeTraits.
conjunction and disjunction seem to be neither.
21.3.2 [meta.rqmts] also requires the BaseCharacteristic for both UnaryTypeTraits and
BinaryTypeTraits to be a specialization of integral_constant, which is inconsistent with the current design of
conjunction and disjunction.
The requirement in 21.3.2 [meta.rqmts] that "member names of the BaseCharacteristic shall not be hidden
and shall be unambiguously available" seems impossible to meet in every case, since the arbitrary base class from which a
specialization of conjunction or disjunction derives may contain members called conjunction or
disjunction that will necessarily be hidden.
[2016-08 Chicago]
Ville provided wording for both 2567(i) and 2568(i).
[2016-08-07 Daniel provides wording borrowed from 2567(i)]
[2016-11-08, Issaquah]
Adopted during NB comment resolution
Proposed resolution:
This wording is relative to N4600.
In 3.3.3 [fund.ts.v2::meta.logical] p3, edit as follows:
template<class... B> struct conjunction : see below { };-2- The class template
-3- Theconjunctionforms the logical conjunction of its template type arguments. Every template type argument shall be usable as a base class and shall have a static data membervaluewhich is convertible tobool, is not hidden, and is unambiguously available in the type.BaseCharacteristic of aspecializationconjunction<B1, …, BN>has a public and unambiguous base that is either
- — the first type
Biin the listtrue_type, B1, ..., BNfor whichbool(Bi::value)isfalse, or- — if there is no such
Bi, the last type in the list.-?- The member names of the base class, other than
is the first type[Note: This means a specialization of conjunction does not necessarilyBin the listtrue_type, B1, …, BNfor whichB::value == false, or ifevery B::value != falsethe BaseCharacteristic is the last type in the list.have a BaseCharacteristic ofinherit from eithertrue_typeorfalse_type. — end note]conjunctionandoperator=, shall not be hidden and shall be unambiguously available inconjunction.
In 3.3.3 [fund.ts.v2::meta.logical] p6, edit as follows:
template<class... B> struct disjunction : see below { };-5- The class template
-6- Thedisjunctionforms the logical disjunction of its template type arguments. Every template type argument shall be usable as a base class and shall have a static data membervaluewhich is convertible tobool, is not hidden, and is unambiguously available in the type.BaseCharacteristic of aspecializationdisjunction<B1, …, BN>has a public and unambiguous base that is either
- — the first type
Biin the listfalse_type, B1, ..., BNfor whichbool(Bi::value)istrue, or,- — if there is no such
Bi, the last type in the list.-?- The member names of the base class, other than
is the first type[Note: This means a specialization of disjunction does not necessarilyBin the listfalse_type, B1, …, BNfor whichB::value != false, or ifevery B::value == falsethe BaseCharacteristic is the last type in the list.have a BaseCharacteristic ofinherit from eithertrue_typeorfalse_type. — end note]disjunctionandoperator=, shall not be hidden and shall be unambiguously available indisjunction.
In 3.3.3 [fund.ts.v2::meta.logical] p8, edit as follows:
template<class B> struct negation :integral_constant<bool, !B::value>see below { };-8- The class template
negationforms the logical negation of its template type argument. The typenegation<B>is a UnaryTypeTrait with a BaseCharacteristic ofintegral_constant<bool, !bool(B::value)>.