[MultiIndex] How to extract a key-extractor?
Hello, The following code is expected to get the key-extractor, but it doesn't compile. How to do this correctly? Thanks. #include <boost/multi_index_container.hpp> #include <boost/multi_index/ordered_index.hpp> #include <boost/multi_index/mem_fun.hpp> struct A { int f() const { return 0; } }; typedef boost::multi_index::multi_index_container< int, boost::multi_index::indexed_by< boost::multi_index::ordered_unique< boost::multi_index::const_mem_fun<A, int, &A::f> > >
container_type;
typedef container_type::key_from_value_type extractor_type; // doesn't compile typedef container_type::nth_index<0>::key_from_value_type extractor_type; // doesn't compile
The following code is expected to get the key-extractor, but it doesn't compile. How to do this correctly?
Solved. It turns out that I've oversight key_extractor() member-function: http://www.boost.org/doc/libs/1_54_0/libs/multi_index/doc/reference/ord_indi...
participants (1)
-
Igor R