
Igor R escribió:
Hello,
Consider the following types:
typedef tuple<std::string, int> Item; typedef multi_index_container< Item, indexed_by< ordered_non_unique<global_fun<const Item &, int, &tuples::get<1> > >
Items;
The above types don't compile (MSVC10) because of &tuples::get<1>: C2440: 'specialization' : cannot convert from 'overloaded-function' to 'int (__cdecl *)(boost::tuples::tuple<T0,T1> &)' It seems there're several overloaded function templates "tuples::get"...
So, what's the correct type of the appropriate function? Or -- is there a more "robust" way to extract the key (without defining explicit function-object)?
There can be a number of problems in trying to reference Boost.Tuple extractors directly. Have a look at http://lists.boost.org/boost-users/2005/12/16088.php for a discussion and a proposed solution (search for tuple_member_extractor at the bottom of the post). Joaquín M López Muñoz Telefónica, Investigación y Desarrollo