vendredi 6 mars 2015

Bi-directional hash map, with a vector as value



struct MyStruct
{
vector<A> a_vect;
vector<B> b_vect;
std:string my_string;
}


I need to maintain a data structure that maps a key:



int key;


To an instance of MyStruct.


And also vis-versa, so if I receive: A a or B b or std::string c I can find back which key points to a MyStruct object that contains a vector that contains a or b, or the string c.


I was looking at boost::multi-index map but couldn't find if this is doable. If so, how?




Aucun commentaire:

Enregistrer un commentaire