2569. conjunction and disjunction requirements are too strict

Section: 23.15.8 [meta.logical] Status: C++17 Submitter: Tim Song Opened: 2015-12-11 Last modified: 2017-12-05

Priority: 2

View all other issues in [meta.logical].

View all issues with C++17 status.

Discussion:

23.15.8 [meta.logical]/2 and /5 impose the following requirement on the arguments of conjunction and disjunction:

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.

Since the requirement is unconditional, it applies even to type arguments whose instantiation is not required due to short circuiting. This seems contrary to the design intent, expressed in P0013R1, that it is valid to write conjunction_v<is_class<T>, is_foo<T>> even if instantiating is_foo<T>::value is ill-formed for non-class types.

[2016-08 Chicago]

Ville provided wording for both 2569 and 2570.

Tuesday AM: Move to Tentatively Ready

[2016-11-15, Reopen upon request of Dawn Perchik ]

The proposed wording requires an update, because the referenced issue LWG 2568 is still open.

[Dec 2017 - The resolution for this issue shipped in the C++17 standard; setting status to 'C++17']

Proposed resolution:

[We recommend applying the proposed resolution for LWG issues 2567 and 2568 before this proposed resolution, lest the poor editor gets confused.]

In [meta.logical],

- insert a new paragraph before paragraph 2:

The class template conjunction forms the logical conjunction of its template type arguments.

- move paragraph 4 before paragraph 2, and edit paragraph 2 as follows:

The class template conjunction forms the logical conjunction of its template type arguments. Every template type argument for which Bi::value is instantiated shall be usable as a base class and shall have a member value which is convertible to bool, is not hidden, and is unambiguously available in the type.

- insert a new paragraph before paragraph 5:

The class template disjunction forms the logical disjunction of its template type arguments.

- move paragraph 7 before paragraph 5, and edit paragraph 5 as follows:

The class template disjunction forms the logical disjunction of its template type arguments. Every template type argument for which Bi::value is instantiated shall be usable as a base class and shall have a member value which is convertible to bool, is not hidden, and is unambiguously available in the type.