I'm looking for a bidirectional unordered map. Currently, I just have this. The problem is, that I can't use []
. What I think is that boost defaults to list types. But I want a hashmap. How's this possible?
#include <string>
#include <boost/bimap.hpp>
boost::bimap<std::string, size_t> indices;
// ...
size_t index = 42;
indices.right[index].second = "name"; // This doesn't work.
On the overview page, I found out that unordered_set_of
makes the bimap behave like a hashmap. However, I can't modify values once inserted.