we need a container that keeps its elements sorted by the element’s priority when appending a new element, that has the ability to retrieve an element given it’s id.
(the problem with priority queue is that it doesn’t give you the ability to retrieve an element according to id and not priority)
thanks
boost multi index containers give you the ability to have a sorted view on priority and a sorted view on ID.
A small example: