If I have understood well, you want a std::map (or, even better, a std::unordered_map<> since you want hashes) where A is a string and B can be a int, double or std::string.
For B you can use boost::any<>. Otherwise, if you don't want to use boost, you can use a discriminated union.