Movatterモバイル変換


[0]ホーム

URL:



This page is a snapshot from the LWG issues list, see theLibrary Active Issues List for more information and the meaning ofC++17 status.

2567. Specification of logical operator traits usesBaseCharacteristic, which is defined only forUnaryTypeTraits andBinaryTypeTraits

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

[2016-08 Chicago]

Ville provided wording for both2567(i) and2568(i)

Previous resolution [SUPERSEDED]:

In [meta.logical]/3, edit as follows:

TheBaseCharacteristic of a specializationconjunction<B1, ..., BN>has a public and unambiguous base thatis the first typeBi in the listtrue_type, B1, ..., BN forwhichBi::value == false, or if everyBi::value != false, theaforementioned baseBaseCharacteristic isthe 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:

TheBaseCharacteristic of a specializationdisjunction<B1, ..., BN>has a public and unambiguous base thatis the first typeBi in the listfalse_type, B1, ..., BN forwhichBi::value != false, or if everyBi::value == false, theaforementioned baseBaseCharacteristic isthe 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]:

In [meta.logical]/3, edit as follows:

TheBaseCharacteristic of a specializationconjunction<B1, ..., BN>has a public and unambiguous base that is either
* the first typeBi in the listtrue_type, B1, ..., BN forwhichBi::value == false, or
* if there is no suchBi, the last type in the list.

is the first typeBi in the listtrue_type, B1, ..., BN forwhichBi::value == false, or if everyBi::value != false, theBaseCharacteristic is the last type in the list.
[ Note: This means a specialization ofconjunction doesnot necessarilyhave a BaseCharacteristicofderive from either true_type orfalse_type. — end note ]

In [meta.logical]/6, edit as follows:

TheBaseCharacteristic of a specializationdisjunction<B1, ..., BN>has a public and unambiguous base that is either
* the first typeBi in the listtrue_type, B1, ..., BN forwhichBi::value != false, or
* if there is no suchBi, the last type in the list.

is the first typeBi in the listtrue_type, B1, ..., BN forwhichBi::value != false, or if everyBi::value == false, theBaseCharacteristic is the last type in the list.
[ Note: This means a specialization ofdisjunction doesnot necessarilyhave a BaseCharacteristicofderive from either true_type orfalse_type. — end note ]

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.

Previous resolution [SUPERSEDED]:

This wording is relative to N4606.

  1. In 21.3.10[meta.logical] p3, edit as follows:

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

    -3- TheBaseCharacteristic of a specializationconjunction<B1, ..., BN>has a public and unambiguous base that is either

    • the first typeBi in the listtrue_type, B1, ..., BN forwhichbool(Bi::value) isfalse, or
    • if there is no suchBi, the last type in the list.
    is the first typeBi in the listtrue_type, B1, ..., BN forwhichBi::value == false, or if everyBi::value != false, theBaseCharacteristic is the last type in the list.

    -?- The member names of the base class, other thanconjunction andoperator=,shall not be hidden and shall be unambiguously available inconjunction. [Note:This means a specialization ofconjunction does not necessarilyhave a BaseCharacteristicofinherit from eithertrue_type orfalse_type.—end note]

  2. In 21.3.10[meta.logical] p6, edit as follows:

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

    -6- TheBaseCharacteristic of a specializationdisjunction<B1, ..., BN>has a public and unambiguous base that is either

    • the first typeBi in the listtrue_type, B1, ..., BN forwhichbool(Bi::value) istrue, or,
    • if there is no suchBi, the last type in the list.
    is the first typeBi in the listtrue_type, B1, ..., BN forwhichBi::value != false, or if everyBi::value == false, theBaseCharacteristic is the last type in the list.

    -?- The member names of the base class, other thandisjunction andoperator=,shall not be hidden and shall be unambiguously available indisjunction. [Note:Thismeans a specialization ofdisjunction does not necessarilyhave a BaseCharacteristicofinherit from eithertrue_type orfalse_type.—end note]

  3. 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 typenegation<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.

  1. In 21.3.10[meta.logical] p3, edit as follows:

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

    […]

    -3- TheBaseCharacteristic of a specializationconjunction<B1, ..., BN>has a public and unambiguous base that is either

    1. the first typeBi in the listtrue_type, B1, ..., BN forwhichbool(Bi::value) isfalse, or
    2. if there is no suchBi, the last type in the list.
    is the first typeBi in the listtrue_type, B1, ..., BN forwhichBi::value == false, or if everyBi::value != false, theBaseCharacteristic is the last type in the list.[Note:This means a specialization ofconjunction does not necessarilyhave a BaseCharacteristicofinherit from eithertrue_type orfalse_type.—end note]

    -?- The member names of the base class, other thanconjunction andoperator=,shall not be hidden and shall be unambiguously available inconjunction.

  2. In 21.3.10[meta.logical] p6, edit as follows:

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

    […]

    -6- TheBaseCharacteristic of a specializationdisjunction<B1, ..., BN>has a public and unambiguous base that is either

    1. the first typeBi in the listfalse_type, B1, ..., BN forwhichbool(Bi::value) istrue, or,
    2. if there is no suchBi, the last type in the list.
    is the first typeBi in the listfalse_type, B1, ..., BN forwhichBi::value != false, or if everyBi::value == false, theBaseCharacteristic is the last type in the list.[Note:Thismeans a specialization ofdisjunction does not necessarilyhave a BaseCharacteristicofinherit from eithertrue_type orfalse_type.—end note]

    -?- The member names of the base class, other thandisjunction andoperator=,shall not be hidden and shall be unambiguously available indisjunction.

  3. In 21.3.10[meta.logical] p8, edit as follows

    template<class B> struct negation :see belowbool_constant<!B::value> { };

    -8- The class template negation forms the logical negation of its template type argument. The typenegation<B> is a UnaryTypeTrait with a BaseCharacteristic ofbool_constant<!bool(B::value)>.


[8]ページ先頭

©2009-2026 Movatter.jp