3211. std::tuple<> should be trivially constructible

Section: 22.4.4.2 [tuple.cnstr] Status: C++23 Submitter: Louis Dionne Opened: 2019-05-29 Last modified: 2023-11-22

Priority: 3

View other active issues in [tuple.cnstr].

View all other issues in [tuple.cnstr].

View all issues with C++23 status.

Discussion:

That requirement is really easy to enforce, and it has been requested by users (e.g. libc++ bug 41714).

Previous resolution [SUPERSEDED]:

This wording is relative to N4810.

  1. Modify 22.4.4.2 [tuple.cnstr] as indicated:

    -4- If is_trivially_destructible_v<Ti> is true for all Ti, then the destructor of tuple is trivial. The default constructor of tuple<> is trivial.

[2020-02-13, Prague]

LWG discussion revealed that all where happy that we want this, except that the new wording should become a separate paragraph.

[2020-11-09 Approved In November virtual meeting. Status changed: Ready → WP.]

Proposed resolution:

This wording is relative to N4849.

  1. Modify 22.4.4.2 [tuple.cnstr] as indicated:

    -4- If is_trivially_destructible_v<Ti> is true for all Ti, then the destructor of tuple is trivial.

    -?- The default constructor of tuple<> is trivial.