Is there a way to encapsulate std::map
within a user-defined class, allowing iteration, but not allowing direct access to the key?
I would like to manipulate the key upon insertion and I want to force all access to elements through a user-defined method (as the key will need to be modified).
I think the problem is allowing iterating over the map, whilst preventing the user from accessing the key via the iterator.