Section: 3.3.3 [fund.ts.v2::meta.logical] Status: TS Submitter: Geoffrey Romer Opened: 2015-11-05 Last modified: 2017-07-30
Priority: 0
View all other issues in [fund.ts.v2::meta.logical].
View all issues with TS status.
Discussion:
Addresses: fund.ts.v2
The conjunction trait in 3.3.3 [fund.ts.v2::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 3.3.3 [fund.ts.v2::meta.logical]/p3:
The BaseCharacteristic of a specialization
conjunction<B1, …, BN>
is the first typeB
in the listtrue_type
,B1
, …,BN
for whichB::value == false
, or if everyB::value != false
the BaseCharacteristic isBN
.
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.
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.
[2016-02, Issues Telecon]
P0; move to Tentatively Ready.
Proposed resolution:
This wording is relative to N4562.
Revise 3.3.3 [fund.ts.v2::meta.logical] as follows:
template<class... B> struct conjunction : see below { };[…]
-3- The BaseCharacteristic of a specializationconjunction<B1, ..., BN>
is the first typeBi
in the listtrue_type, B1, ..., BN
for whichBi::value == false
, or if everyBi::value != false
, the BaseCharacteristic isthe last type in the list. [Note: This means a specialization ofBN
conjunction
does not necessarily have a BaseCharacteristic of eithertrue_type
orfalse_type
. — end note] […]template<class... B> struct disjunction : see below { };[…]
-6- The BaseCharacteristic of a specializationdisjunction<B1, ..., BN>
is the first typeBi
in the listfalse_type, B1, ..., BN
for whichBi::value != false
, or if everyBi::value == false
, the BaseCharacteristic isthe last type in the list. [Note: This means a specialization ofBN
disjunction
does not necessarily have a BaseCharacteristic of eithertrue_type
orfalse_type
. — end note] […]