Created on 2017-02-06.00:00:00 last changed 3 months ago
Proposed resolution:
This wording is relative to N4640.
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]
[ 2024-07-25 Status changed: New → Resolved. ]
Resolved by p2968r2, approved in St. Louis.
[ 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".
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:Keep the current changes proposed by the PR.
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 |
2024-07-25 11:38:45 | admin | set | messages: + msg14263 |
2024-07-25 11:38:45 | admin | set | status: new -> resolved |
2017-03-14 03:14:09 | admin | set | messages: + msg9116 |
2017-02-19 14:34:53 | admin | set | messages: + msg8947 |
2017-02-06 00:00:00 | admin | create |