This page is a snapshot from the LWG issues list, see theLibrary Active Issues List for more information and the meaning ofC++17 status.
BaseCharacteristic, which is defined only forUnaryTypeTraits andBinaryTypeTraitsSection: 21.3.10[meta.logical]Status:C++17Submitter: Tim SongOpened: 2015-12-10Last modified: 2017-07-30
Priority:2
View all otherissues in [meta.logical].
View all issues withC++17 status.
Discussion:
The specification ofconjunction anddisjunction uses the termBaseCharacteristic, which is problematic in several ways:
That term is defined in 21.3.2[meta.rqmts], but only forUnaryTypeTraits andBinaryTypeTraits.conjunction anddisjunction seem to be neither.
21.3.2[meta.rqmts] also requires theBaseCharacteristic for bothUnaryTypeTraits andBinaryTypeTraits to be a specialization ofintegral_constant, which is inconsistent with the current design ofconjunction anddisjunction.
The requirement in 21.3.2[meta.rqmts] that "member names of theBaseCharacteristic 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 ofconjunction ordisjunction derives may contain members calledconjunction ordisjunction that will necessarily be hidden.
[2016-08 Chicago]
Ville provided wording for both2567(i) and2568(i)
Previous resolution [SUPERSEDED]:
In [meta.logical]/3, edit as follows:
The
BaseCharacteristic of aspecializationconjunction<B1, ..., BN>has a public and unambiguous base thatis the first typeBiin the listtrue_type, B1, ..., BNforwhichBi::value == false, or if everyBi::value != false, theaforementioned baseBaseCharacteristicisthe last type in the list.[ Note: This means a specialization of conjunction doesnot necessarilyhave a BaseCharacteristicofderive from either true_type orfalse_type. — end note ]In [meta.logical]/6, edit as follows:
The
BaseCharacteristic of aspecializationdisjunction<B1, ..., BN>has a public and unambiguous base thatis the first typeBiin the listfalse_type, B1, ..., BNforwhichBi::value != false, or if everyBi::value == false, theaforementioned baseBaseCharacteristicisthe last type in the list.[ Note: This means a specialization of disjunction doesnot necessarilyhave a BaseCharacteristicofderive from either true_type orfalse_type. — end note ]
Previous resolution [SUPERSEDED]:
Merged the resolution of2587(i) with this issue. This proposed resolutionresolves both, and includes fixes from Daniel for negation.Last review of this with LWG turned up a true_type typo in the definition of disjunction, and some editorial changes.In [meta.logical]/3, edit as follows:
The
BaseCharacteristic of aspecializationconjunction<B1, ..., BN>has a public and unambiguous base that is either
* the first typeBiin the listtrue_type, B1, ..., BNforwhichBi::value == false, or
* if there is no suchBi, the last type in the list.is the first typeBiin the listtrue_type, B1, ..., BNforwhichBi::value == false, or if everyBi::value != false, theBaseCharacteristic is the last type in the list.
[ Note: This means a specialization ofconjunctiondoesnot necessarilyhave a BaseCharacteristicofderive from either true_type orfalse_type. — end note ]In [meta.logical]/6, edit as follows:
The
BaseCharacteristic of aspecializationdisjunction<B1, ..., BN>has a public and unambiguous base that is either
* the first typeBiin the listtrue_type, B1, ..., BNforwhichBi::value != false, or
* if there is no suchBi, the last type in the list.is the first typeBiin the listtrue_type, B1, ..., BNforwhichBi::value != false, or if everyBi::value == false, theBaseCharacteristic is the last type in the list.
[ Note: This means a specialization ofdisjunctiondoesnot necessarilyhave a BaseCharacteristicofderive from either true_type orfalse_type. — end note ]
Previous resolution [SUPERSEDED]:
This wording is relative to N4606.
In 21.3.10[meta.logical] p3, edit as follows:
template<class... B> struct conjunction :see below { };-3- The
BaseCharacteristic of aspecializationconjunction<B1, ..., BN>has a public and unambiguous base that is either
- the first type
Biin the listtrue_type, B1, ..., BNforwhichbool(Bi::value)isfalse, or- if there is no such
Bi, the last type in the list.is the first typeBiin the listtrue_type, B1, ..., BNforwhichBi::value == false, or if everyBi::value != false, theBaseCharacteristic is the last type in the list.-?- The member names of the base class, other than
conjunctionandoperator=,shall not be hidden and shall be unambiguously available inconjunction. [Note:This means a specialization ofconjunctiondoes not necessarilyhave a BaseCharacteristicofinherit from eithertrue_typeorfalse_type.—end note]In 21.3.10[meta.logical] p6, edit as follows:
template<class... B> struct disjunction :see below { };-6- The
BaseCharacteristic of aspecializationdisjunction<B1, ..., BN>has a public and unambiguous base that is either
- the first type
Biin the listtrue_type, B1, ..., BNforwhichbool(Bi::value)istrue, or,- if there is no such
Bi, the last type in the list.is the first typeBiin the listtrue_type, B1, ..., BNforwhichBi::value != false, or if everyBi::value == false, theBaseCharacteristic is the last type in the list.-?- The member names of the base class, other than
disjunctionandoperator=,shall not be hidden and shall be unambiguously available indisjunction. [Note:Thismeans a specialization ofdisjunctiondoes not necessarilyhave a BaseCharacteristicofinherit from eithertrue_typeorfalse_type.—end note]In 21.3.10[meta.logical] p8, edit as follows
template<class B> struct negation : bool_constant<!bool(B::value)> { };-8- The class template negation forms the logical negation of its template type argument. The type
negation<B>is a UnaryTypeTrait with a BaseCharacteristic ofbool_constant<!bool(B::value)>.
[2016-08-03 Chicago]
Fri AM: Moved to Tentatively Ready
Proposed resolution:
This wording is relative to N4606.
In 21.3.10[meta.logical] p3, edit as follows:
template<class... B> struct conjunction :see below { };[…]
-3- TheBaseCharacteristic of aspecializationconjunction<B1, ..., BN>has a public and unambiguous base that is either
- —the first type
Biin the listtrue_type, B1, ..., BNforwhichbool(Bi::value)isfalse, or- —if there is no such
Bi, the last type in the list.is the first type[Note:This means a specialization ofBiin the listtrue_type, B1, ..., BNforwhichBi::value == false, or if everyBi::value != false, theBaseCharacteristic is the last type in the list.conjunctiondoes not necessarilyhave a BaseCharacteristicofinherit from eithertrue_typeorfalse_type.—end note]-?- The member names of the base class, other than
conjunctionandoperator=,shall not be hidden and shall be unambiguously available inconjunction.
In 21.3.10[meta.logical] p6, edit as follows:
template<class... B> struct disjunction :see below { };[…]
-6- TheBaseCharacteristic of aspecializationdisjunction<B1, ..., BN>has a public and unambiguous base that is either
- —the first type
Biin the listfalse_type, B1, ..., BNforwhichbool(Bi::value)istrue, or,- —if there is no such
Bi, the last type in the list.is the first type[Note:Thismeans a specialization ofBiin the listfalse_type, B1, ..., BNforwhichBi::value != false, or if everyBi::value == false, theBaseCharacteristic is the last type in the list.disjunctiondoes not necessarilyhave a BaseCharacteristicofinherit from eithertrue_typeorfalse_type.—end note]-?- The member names of the base class, other than
disjunctionandoperator=,shall not be hidden and shall be unambiguously available indisjunction.
In 21.3.10[meta.logical] p8, edit as follows
template<class B> struct negation :see below{ };bool_constant<!B::value>
-8- The class template negation forms the logical negation of its template type argument. The type
negation<B>is a UnaryTypeTrait with a BaseCharacteristic ofbool_constant<!bool(B::value)>.