I currently am using a map in C++ and have a couple of values that are ints and booleans, though the majority of them are strings. I know in Java I could do something like this:
You can have several different maps, and hide the lookup in overloaded functions:
std::map map_int; std::map map_string; Object& lookup(int Key) { return map_int[Key]; } Object& lookup(std::string Key) { return map_string[Key]; }
Now all your lookups kan be done with lookup(key).
lookup(key)