B
barcaroller
I have a map<T*> that stores pointers to objects. How can I tell map<T*> to
use the objects' operator<() and not the value of the pointers for sorting?
If that's not feasible, what alternatives do I have to sort a set of objects
that cannot and should not be copied (i.e. I can use only pointers to these
objects)?
Note: I am aware of the method of creating a new class that wraps the
pointers of the objects and then provides its own operator<(). However, I
am trying to avoid creating new classes.
use the objects' operator<() and not the value of the pointers for sorting?
If that's not feasible, what alternatives do I have to sort a set of objects
that cannot and should not be copied (i.e. I can use only pointers to these
objects)?
Note: I am aware of the method of creating a new class that wraps the
pointers of the objects and then provides its own operator<(). However, I
am trying to avoid creating new classes.