Boost Bimap

Storing objects and looking them up using a key is a very common programming chore, and every language has some measure of support for it through native constructs or libraries in the form of dictionaries or lookup tables. In C++, the std::map and std::multimap containers (and their unordered variants) provide the lookup table abstraction. Traditionally, such libraries support lookups in one direction. Given a key you can look up a value and this is adequate for many cases. But sometimes, we also need a way to look up a key given a value, and the standard library associative containers are of little help in such cases; what we need there is the Boost Bimap library.

The Boost Bimap library provides bimaps or bidirectional map data structures ...

Get Learning Boost C++ Libraries now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.