I would like to deduce the tag from the iterator of boost::multi_index, is it possible?
pseudo codes
struct digital_base_struct
{
digital_base_struct();
std::string description_;
//.......
};
typedef boost::multi_index::multi_index_container<
digital_base_struct,
boost::multi_index::ordered_unique<
boost::multi_index::tag<description_tag>,
boost::multi_index::member<digital_base_struct,
std::string,&digital_base_struct::description_>
>,
//.......
> digital_base_table;
int main()
{
typedef digital_base_table<description_tag>::type descript_table;
typedef descript_table::iterator descript_it;
//is it possible to deduce the tag
//in another word, could I get the type "description_tag" from iterator?
typedef descript_it::tag tag;
}
Cannot find a way to do this correctly, is it possible to do this?I design a type trait to extract the tag of the iterator, but do I have easier solution?