2275. [CD] Why is forward_as_tuple not constexpr?

Section: 23.5.3.4 [tuple.creation] Status: C++14 Submitter: Marshall Clow Opened: 2013-07-30 Last modified: 2017-09-10

Priority: Not Prioritized

View other active issues in [tuple.creation].

View all other issues in [tuple.creation].

View all issues with C++14 status.

Discussion:

Addresses ES 11

In n3471, a bunch of routines from header <tuple> were made constexpr.

make_tuple/tuple_cat/get<>(tuple)/relational operators — all these were "constexpr-ified".

But not forward_as_tuple.

Why not?

This was discussed in Portland, and STL opined that this was "an omission" (along with tuple_cat, which was added)

In discussion on lib@lists.isocpp.org list, Pablo agreed that forward_as_tuple should be constexpr.

[2013-09 Chicago]

Moved to Immediate, this directly addresses an NB comment and the wording is non-controversial.

Accept for Working Paper

Proposed resolution:

This wording is relative to N3691.

  1. Change header <tuple> synopsis, 23.5.1 [tuple.general] as indicated:

    template <class... Types>
      constexpr tuple<Types&&...> forward_as_tuple(Types&&...) noexcept;
    
  2. Change 23.5.3.4 [tuple.creation] before p5 as indicated:

    template <class... Types>
      constexpr tuple<Types&&...> forward_as_tuple(Types&&... t) noexcept;