I have a question on how pointers to a custom object are handled when used as Keys in an map. More specifically if I define
std::map< CustomClass*, int &
Pointers will be handled but compared as pointers (memory order). You have to pass custom less functor if you wish to compare the objects:
less
template struct ptr_less { bool operator()(T* lhs, T* rhs) { return *lhs < *rhs; }}; map> mymap;