The mere fact that I needed to do THIS to make it work... I have no words.
It is now basically a wrapper for std::push_heap, std::pop_heap. The speed tests I did indicated similar performance to the previous version, though more testing could be done on a machine with more RAM.