The first thing is not to use pointer, but a getter (a member function which returns member variable either by value or by const reference).

The problem with map is that its subscript operator...