This page is a snapshot from the LWG issues list, see the Library Active Issues List for more information and the meaning of New status.

3583. Clarify if/when short circuiting applies to conditions in Constraints: elements

Section: [tuple.cnstr] Status: New Submitter: Jonathan Wakely Opened: 2021-08-23 Last modified: 2021-09-24

Priority: 3

View other active issues in [tuple.cnstr].

View all other issues in [tuple.cnstr].

View all issues with New status.


We do not specify whether or not short-circuiting is expected to happen for individual conditions stated in a Constraints: element. For example, [tuple.cnstr] p12 says:

Constraints: sizeof...(Types) equals sizeof...(UTypes) and sizeof...(Types) ≤ 1 and is_constructible_v<Ti , Ui> is true for all i.

It's not even possible to test the is_constructible part unless the first part is true, so presumably it is expected that the sizeof... expressions are tested first, and so the is_constructible traits don't even need to be instantiated.

In some cases it might be user observable whether short circuiting happens, as whether later conditions are tested might affect whether errors outside the immediate context are permitted or not.

We should clarify what is intended, and refactor any Constraints: elements that are special cases where something different is required.

[2021-09-20; Reflector poll]

Set priority to 3 after reflector poll.

Proposed resolution: