2773. Making std::ignore constexpr

Section: 23.5.1 [tuple.general] Status: C++17 Submitter: Vincent Reverdy Opened: 2016-09-10 Last modified: 2017-07-30

Priority: 0

View all other issues in [tuple.general].

View all issues with C++17 status.


Currently std::ignore is not specified constexpr according to the C++ draft N4606 in the paragraph 23.5.1 [tuple.general]. It prevents some use in constexpr context: for example declaring a constexpr variable equals to the result of a function to which std::ignore has been passed as a parameter:

constexpr int i = f(std::ignore); // Won't compile

If there is no fundamental reason preventing std::ignore to be constexpr, then we propose to declare it as constexpr instead of as const.

[Issues processing Telecon 2016-10-7]

P0; set to Tentatively Ready

Proposed resolution:

This wording is relative to N4606.

  1. Modify 23.5.1 [tuple.general] as indicated:

    //, tuple creation functions:
    constconstexpr unspecified ignore;