Boost logo

Boost Users :

Subject: [Boost-users] [tuples, multi-index] tuples::get as key extractor
From: Igor R (boost.lists_at_[hidden])
Date: 2010-08-08 16:27:51


Consider the following types:

typedef tuple<std::string, int> Item;
typedef multi_index_container<
    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)?


Boost-users list run by williamkempf at, kalb at, bjorn.karlsson at, gregod at, wekempf at