Created on 2016-10-14.00:00:00 last changed 46 months ago
Proposed resolution:
This wording is relative to N4606.
Change return type of emplace in class definition in [queue.defn]:
template <class... Args>referencedecltype(auto) emplace(Args&&... args) { return c.emplace_back(std::forward<Args>(args)...); }
Change return type of emplace in class definition in [stack.defn]:
template <class... Args>referencedecltype(auto) emplace(Args&&... args) { return c.emplace_back(std::forward<Args>(args)...); }
[ 2017-03-04, Kona ]
Status to Tentatively Ready.
[ 2016-11-12, Issaquah ]
Sat AM: P2
The stack and queue adaptors are now defined as:
template <class... Args> reference emplace(Args&&... args) { return c.emplace_back(std::forward<Args>(args)...); }
This breaks any code using queue<UserDefinedSequence> or stack<UserDefinedSequence> until the user-defined containers are updated to meet the new C++17 requirements.
If we defined them as returning decltype(auto) then we don't break any code. When used with std::vector or std::deque they will return reference, as required, but when used with C++14-conforming containers they will return void, as before.History | |||
---|---|---|---|
Date | User | Action | Args |
2021-02-25 10:48:01 | admin | set | status: wp -> c++20 |
2017-07-30 20:18:47 | admin | set | status: voting -> wp |
2017-06-26 13:46:20 | admin | set | status: ready -> voting |
2017-03-14 03:14:09 | admin | set | messages: + msg9105 |
2017-03-14 03:14:09 | admin | set | status: new -> ready |
2016-11-21 05:09:01 | admin | set | messages: + msg8666 |
2016-10-15 13:03:26 | admin | set | messages: + msg8565 |
2016-10-14 00:00:00 | admin | create |