Section: 126.96.36.199 [priqueue.members] Status: WP Submitter: Casey Carter Opened: 2022-06-20 Last modified: 2023-02-13 11:31:17 UTC
View all issues with WP status.
The push_range members of the queue (188.8.131.52 [queue.mod]) and stack (184.108.40.206 [stack.mod]) container adaptors are both specified as "Effects: Equivalent to c.append_range(std::forward<R>(rg)) if that is a valid expression, otherwise ranges::copy(rg, back_inserter(c)).". For priority_queue, however, we have instead (220.127.116.11 [priqueue.members]):
-3- Effects: Insert all elements of rg in c.-4- Postconditions: is_heap(c.begin(), c.end(), comp) is true.
Since append_range isn't one of the operations required of the underlying container, "Insert all elements of rg" must be implemented via potentially less efficient means. It would be nice if this push_back could take advantage of append_range when it's available just as do the other two overloads.
[2022-07-08; Reflector poll]
Set priority to 2 after reflector poll.
[Issaquah 2023-02-08; LWG]
Unanimous consent to move to Immediate.
[2023-02-13 Status changed: Immediate → WP.]
This wording is relative to N4910.
Modify 18.104.22.168 [priqueue.members] as indicated:
template<container-compatible-range<T> R> void push_range(R&& rg);
-3- Effects: Insert all elements of rg in c .-4- Postconditions: is_heap(c.begin(), c.end(), comp) is true.