lundi 20 juillet 2015

How to force reorganization of a priority_queue?

I have a priority_queue that contains a vector with some objects.

std::priority_queue<std::shared_ptr<Foo>, std::vector<std::shared_ptr<Foo>>, foo_less> foo_queue;

It has a foo_queue function that will order the priority_queue.

Now, from outside of the priority_queue, I want to change some object value that must influenciate the ordering of the priority_queue.

My question is:

How can I set some kind of "refresh" that will trigger the priority_queue to run the foo_queue() in order to keep it orderes all the time?

Aucun commentaire:

Enregistrer un commentaire