#include #include #include #include #include namespace mi=boost::multi_index; typedef int some_type; typedef std::pair key_value_pair; struct hash{}; //tag used to retrieve values typedef mi::multi_index_container < key_value_pair, mi::indexed_by < mi::hashed_unique < mi::tag, BOOST_MULTI_INDEX_MEMBER(key_value_pair, std::string, first) > > > types_map; types_map types_; inline void create_type(std::string const& name) { types_map::index::type::const_iterator i=types_.get().find(name); } int main() { create_type("hello"); }