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.

2568. [fund.ts.v2] Specification of logical operator traits uses BaseCharacteristic, which is defined only for UnaryTypeTraits and BinaryTypeTraits

Section: 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:

[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.

  1. In 3.3.3 [fund.ts.v2::meta.logical] p3, edit as follows:

    template<class... B> struct conjunction : see below { };
    

    -2- The class template conjunction forms 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 member value which is convertible to bool, is not hidden, and is unambiguously available in the type.

    -3- The BaseCharacteristic of a specialization conjunction<B1, …, BN> has a public and unambiguous base that is either

    1. the first type Bi in the list true_type, B1, ..., BN for which bool(Bi::value) is false, or
    2. if there is no such Bi, the last type in the list.

    is the first type B in the list true_type, B1, …, BN for which B::value == false, or if every B::value != false the BaseCharacteristic is the last type in the list. [Note: This means a specialization of conjunction does not necessarily have a BaseCharacteristic ofinherit from either true_type or false_type. — end note]

    -?- The member names of the base class, other than conjunction and operator=, shall not be hidden and shall be unambiguously available in conjunction.

  2. In 3.3.3 [fund.ts.v2::meta.logical] p6, edit as follows:

    template<class... B> struct disjunction : see below { };
    

    -5- The class template disjunction forms 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 member value which is convertible to bool, is not hidden, and is unambiguously available in the type.

    -6- The BaseCharacteristic of a specialization disjunction<B1, …, BN> has a public and unambiguous base that is either

    1. the first type Bi in the list false_type, B1, ..., BN for which bool(Bi::value) is true, or,
    2. if there is no such Bi, the last type in the list.

    is the first type B in the list false_type, B1, …, BN for which B::value != false, or if every B::value == false the BaseCharacteristic is the last type in the list. [Note: This means a specialization of disjunction does not necessarily have a BaseCharacteristic ofinherit from either true_type or false_type. — end note]

    -?- The member names of the base class, other than disjunction and operator=, shall not be hidden and shall be unambiguously available in disjunction.

  3. 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 negation forms the logical negation of its template type argument. The type negation<B> is a UnaryTypeTrait with a BaseCharacteristic of integral_constant<bool, !bool(B::value)>.