refactor: PriorityQueue, Use std::ranges version of heap methods

This commit is contained in:
sithlord48
2025-07-24 20:57:44 -04:00
committed by Nick Bolton
parent 84c2234869
commit db841f71bd

View File

@ -46,13 +46,13 @@ public:
void push(const value_type &v)
{
c.push_back(v);
std::push_heap(c.begin(), c.end(), comp);
std::ranges::push_heap(c, comp);
}
//! Remove head element
void pop()
{
std::pop_heap(c.begin(), c.end(), comp);
std::ranges::pop_heap(c, comp);
c.pop_back();
}
@ -60,7 +60,7 @@ public:
void erase(iterator i)
{
c.erase(i);
std::make_heap(c.begin(), c.end(), comp);
std::ranges::make_heap(c, comp);
}
//! Get start iterator
@ -85,7 +85,7 @@ public:
void swap(Container &c2) noexcept
{
c.swap(c2);
std::make_heap(c.begin(), c.end(), comp);
std::ranges::make_heap(c, comp);
}
//@}