You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add a fast replace_top method to std::priority_queue.
Also `std::poke_heap(first, last)`, which assumes that the given range
is in max-heap order *except* for the first element, which needs to be
put into its proper place. This is just like `push_heap`, except that
`push_heap` assumes the *last* element is out of order, whereas
`poke_heap` assumes the *first* element is out of order.
The changes in `<queue>` could use `_VSTD::poke_heap` instead of
`__sift_down`, but they do not, in order to keep the `<queue>` changes
usable as a single-file patch (in case someone wants to take the
`<queue>` changes without the `<algorithm>` changes).
The `poke_heap` approach would replace the last line of each
new method with this line instead:
_VSTD::poke_heap(c.begin(), c.end(), comp);
https://reviews.llvm.org/D57734
0 commit comments