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

3346. pair and tuple copy and move constructor have backwards specification

Section: 20.4.2 [pairs.pair], 20.5.3.1 [tuple.cnstr] Status: WP Submitter: Richard Smith Opened: 2019-11-26 Last modified: 2020-02-24

Priority: 0

View other active issues in [pairs.pair].

View all other issues in [pairs.pair].

View all issues with WP status.

Discussion:

20.4.2 [pairs.pair] p2 and 20.5.3.1 [tuple.cnstr] p3 say:

The defaulted move and copy constructor, respectively, of {pair,tuple} is a constexpr function if and only if all required element-wise initializations for copy and move, respectively, would satisfy the requirements for a constexpr function.

Note that we specify the copy constructor in terms of element move operations and the move constructor in terms of element copy operations. Is that really the intent? This appears to be how this was originally specified when the wording was added by N3471.

[2019-12-01; Daniel comments and provides wording]

These inverted wording effects are an unintended oversight caused by N3471.

[2019-12-08 Issue Prioritization]

Status to Tentatively Ready and priority to 0 after ten positive votes on the reflector.

Proposed resolution:

This wording is relative to N4835.

  1. Modify 20.4.2 [pairs.pair] as indicated:

    -2- The defaulted move and copy constructor, respectively, of pair shall be a constexpr function if and only if all required element-wise initializations for copymove and movecopy, respectively, would satisfy the requirements for a constexpr function.

  2. Modify 20.5.3.1 [tuple.cnstr] as indicated:

    -3- The defaulted move and copy constructor, respectively, of tuple shall be a constexpr function if and only if all required element-wise initializations for copymove and movecopy, respectively, would satisfy the requirements for a constexpr function. The defaulted move and copy constructor of tuple<> shall be constexpr functions.