
Hello Edward,
On Wed, Nov 25, 2009 at 10:40 AM, Edward Diener
I would have thought, naively enough, that one of the common uses of a bimap was that one should be able to create a bimap from a std::map as long as the relation between the two types was unique both ways.
Yes, this is a very common scenario.
I was disconcerted when I did not see a bimap constructor that accepted a std::map of the same types,
The library does not have this constructor by design. A bimap can be
viewed as a map (if you choose the left or the right view) but it is
not directly compatible with a map to enforce the idea that both
values are at the same level in the container. You explicitly have to
choose the left view to do what you are trying to achieve:
std::map