Re: [PATCH] libstdc++: Clear std::priority_queue after moving from it [PR118088]

2024-12-18 Thread Patrick Palka
On Wed, 18 Dec 2024, Jonathan Wakely wrote: > We don't know what state an arbitrary sequence container will be in > after moving from it, so a moved-from std::priority_queue needs to clear > the moved-from container to ensure it doesn't contain elements that are > in an invalid order for the queue

[PATCH] libstdc++: Clear std::priority_queue after moving from it [PR118088]

2024-12-17 Thread Jonathan Wakely
We don't know what state an arbitrary sequence container will be in after moving from it, so a moved-from std::priority_queue needs to clear the moved-from container to ensure it doesn't contain elements that are in an invalid order for the queue. An alternative would be to call std::make_heap agai