I am looking for a type of container in which pointers to objects do not change on item addition/removal (even from the middle). Order of items with the same priority can change.
It can be a part of Boost. Ideas?
Why?
So I can keep objects in one place (one container) and still have them sorted. There is a need to pass pointers to other objects.
In case of std::set
Is it safe to store pointers of MyType
to elements of such a set? The elements are going to be modified by member functions of each, but properties used for comparison will remain intact through lifetime of each object in a set.
Update: in case someone decided to stick with C++ STD or head toward Boost; it is worth to look at this: Boost MultiIndex