What data structure do you prefer if you have two keys, and can not use boost::multiindex
?
I can have multiple records with Key1 and/or Key2 but there will be only one record for the combination of KEY1 KEY2. My requirements are that I should be able to search
- All the records for KEY1
- All the records for KEY2
- Single record given KEY1 and KEY2
Currently I am using std::map
std::map <CString, std::vector<CutomClass>> m_map;
the So first key is used in map and another is part of my class (this class has more data alone with second key)
Is there any other data structure I can use instead?
I cant use boost library for some reason so I am looking for suggestion only from standard library.