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

2275. [CD] Why is forward_as_tuple not constexpr?

Section: [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.


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 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, 19.5.1 [tuple.general] as indicated:

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

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