Title
[fund.ts.v2] Specification of logical operator traits uses BaseCharacteristic, which is defined only for UnaryTypeTraits and BinaryTypeTraits
Status
open
Section
[meta.logical]
Submitter
Tim Song

Created on 2015-12-10.00:00:00 last changed 90 months ago

Messages

Date: 2016-11-20.18:55:07

Proposed resolution:

This wording is relative to N4600.

  1. In [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 [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 [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)>.

Date: 2016-11-15.00:00:00

[ 2016-11-08, Issaquah ]

Adopted during NB comment resolution

Date: 2016-08-07.00:00:00

[ 2016-08-07 Daniel provides wording borrowed from 2567 ]

Date: 2016-08-02.12:53:51

[ 2016-08 Chicago ]

Ville provided wording for both 2567 and 2568.

Date: 2015-12-10.00:00:00

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 [meta.rqmts], but only for UnaryTypeTraits and BinaryTypeTraits. conjunction and disjunction seem to be neither.

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

History
Date User Action Args
2017-07-30 20:10:41adminsetstatus: wp -> open
2016-11-20 18:55:07adminsetmessages: + msg8650
2016-11-20 18:55:07adminsetstatus: open -> wp
2016-08-07 11:17:37adminsetmessages: + msg8459
2016-08-07 11:17:37adminsetmessages: + msg8458
2016-08-07 11:17:37adminsetstatus: new -> open
2016-08-02 12:53:51adminsetmessages: + msg8300
2015-12-10 00:00:00admincreate