
Hi, Boost.Bimap provides a simple translation example and I was wondering whether the library can be used for the general case of many to many relationships, i.e. Hola --< Hello Hola --< Hi Interesante >-- Cool Frio >-- Cool so that I basically can have two multimaps coupled together rather than having to build them separately Thanks and regards jose

On 2/23/07, Jose <jmalv04@gmail.com> wrote:
Hi,
Boost.Bimap provides a simple translation example and I was wondering whether the library can be used for the general case of many to many relationships, i.e.
Hola --< Hello Hola --< Hi Interesante >-- Cool Frio >-- Cool
so that I basically can have two multimaps coupled together rather than having to build them separately
Hi Jose, Yes, Boost.Bimap provides a one-to-one mapping as it default. (bimap<X,Y>) But the library is a framework for bidirectional mapping, and your request is included in it. I recommend you to read the library tutorial where it is explained how to control the constraints of the bimap. Basically you have to think that you are mapping two set types. For example: bimap<X,Y> is the same as bimap< set_of<X>, set_of<Y> > The container you are looking for will be a bimap< multiset_of<std::string>, multiset_of<std::string> > I encourage you to read the first pages of the tutorial. Best regards Matias
participants (2)
-
Jose
-
Matias Capeletto