Title
[fund.ts.v2] Logical operator traits are broken in the zero-argument case
Status
open
Section
[meta.logical]
Submitter
Geoffrey Romer

Created on 2015-11-05.00:00:00 last changed 81 months ago

Messages

Date: 2016-02-07.20:24:45

Proposed resolution:

This wording is relative to N4562.

  1. Revise [meta.logical] as follows:

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

    […]

    -3- The BaseCharacteristic of a specialization conjunction<B1, ..., BN> is the first type Bi in the list true_type, B1, ..., BN for which Bi::value == false, or if every Bi::value != false, the BaseCharacteristic is BNthe last type in the list. [Note: This means a specialization of conjunction does not necessarily have a BaseCharacteristic of either true_type or false_type. — end note]

    […]

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

    […]

    -6- The BaseCharacteristic of a specialization disjunction<B1, ..., BN> is the first type Bi in the list false_type, B1, ..., BN for which Bi::value != false, or if every Bi::value == false, the BaseCharacteristic is BNthe last type in the list. [Note: This means a specialization of disjunction does not necessarily have a BaseCharacteristic of either true_type or false_type. — end note]

    […]

Date: 2016-02-07.20:24:45

[ 2016-02, Issues Telecon ]

P0; move to Tentatively Ready.

Date: 2015-12-10.19:37:05

Addresses: fund.ts.v2

The conjunction trait in [meta.logical] seems intended to support invocation with zero arguments, e.g. conjunction<>::value, which is likely to be a useful feature. However, the specification doesn't actually make sense in the zero-argument case. See [meta.logical]/p3:

The BaseCharacteristic of a specialization conjunction<B1, …, BN> 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 BN.

If "B1, ..., BN" is an empty list, then every B::value != false, so the BaseCharacteristic is BN, but there is no BN in this case.

(If LWG concludes that conjunction intentionally requires at least one argument, I would appreciate their confirmation that I can editorially remove the mention of true_type, which seems to have no normative impact outside the zero-argument case.)

Similar comments apply to the disjunction trait, and to the corresponding traits in the C++ working paper, see LWG 2557.

History
Date User Action Args
2017-07-30 20:10:41adminsetstatus: wp -> open
2016-03-07 04:18:55adminsetstatus: ready -> wp
2016-02-07 20:24:45adminsetmessages: + msg7957
2016-02-07 20:24:45adminsetstatus: new -> ready
2015-12-09 20:35:53adminsetmessages: + msg7632
2015-11-05 00:00:00admincreate