Do not use pointer addresses in a map key because they will sort by address. The chances of an error are approximately 100%. Use std::string instead, which will compare string content.