A wrapper for std::map allowing multiple different types in the data feild.
include the hpp file.
- Namespace: bx
- Class: mtypemap
- mtypemap functions:
void set<VariableType>(std::string key, T variable)
T& get<VariableType>(std::string key)
bool is_set(std::string key)
void remove(std::string key)
e.g:
bx::mtypemap<std::string> m;
m.set<int>("an int", 413);
m.set<double>("a double", 782.38);
m.get<int>("an int")++;
std::cout << m.get<int>("an int");
Uses std::unordered_map to store a key and data, where data is a void pointer.