Title
PR for LWG 2773 could be clearer
Status
new
Section
[tuple.creation]
Submitter
Eric Fiselier

Created on 2017-02-06.00:00:00 last changed 85 months ago

Messages

Date: 2017-03-14.03:14:09

Proposed resolution:

This wording is relative to N4640.

  1. Modify [tuple.creation] as indicated:

    template<class... TTypes>
      constexpr tuple<TTypes&...> tie(TTypes&... t) noexcept;
    

    -7- Returns: […]

    -?- [Note: The constructors and assignment operators provided by ignore shall be constexpr. — end note]

    -8- [Example: […] — end example]

Date: 2017-03-15.00:00:00

[ 2017-03-04, Kona ]

Set priority to 3. P/R is incorrect; it should NOT be a note. Marshall to work with Eric to get better wording. STL says "use an exposition-only class".

Date: 2017-02-06.00:00:00

The current PR for LWG 2773 changes std::ignore to be a constexpr variable. However it says nothing about whether using std::ignore in std::tie is a constant expression. I think the intent was clearly to allow this. Therefore I suggest we update the resolution to explicitly call this out in a note. (I don't think new normative wording is needed).

I propose we update the current PR as follows:

  1. Keep the current changes proposed by the PR.

  2. Add a note after [tuple.creation]/p7 (std::tie):

    [Note: The constructors and assignment operators provided by ignore shall be constexpr]

Perhaps LWG feels the existing wording is clear enough, but if not I think the above changes sufficiently clarify it.

The ability to constexpr assign to std::ignore can be important: Here is an extremely contrived example:

constexpr bool foo() {
  auto res = std::tie(std::ignore);
  std::get<0>(res) =42; 
  return true;
}
static_assert(foo());
History
Date User Action Args
2017-03-14 03:14:09adminsetmessages: + msg9116
2017-02-19 14:34:53adminsetmessages: + msg8947
2017-02-06 00:00:00admincreate