Hello all,
I have a container of the following type:
struct RecsByID {};
struct RecsBySizeAndFit {};
typedef boost::multi_index_container<
boost::shared_ptr<LastSizeFitRecord>,
bmi::indexed_by<
bmi::ordered_unique
RecordsContainer;
The main thing to note above is that the first index is of type "unsigned int" - the record ID. I have a container of unsigned ints which represent the records to be deleted so naturally wanted to do a std::for_each() with a binder and passing in _1 to RecordsContainer::erase. Not that simple because Records::Container::erase has three overloads so I'm trying to come up with a type that will represent the overload I want. I've tried this: RecordsContainer::size_type (RecordsContainer::*erase)(unsigned int) = &RecordsContainer::erase; but it failed to compile. Visual Studio 2003 gives me the following error on the above line: error C2440: 'initializing' : cannot convert from 'overloaded-function' to '<Unknown>' I've decided this particular pointer to member would not be intuitive to use in production code, but I thought I'd try to get it working and failed and would like to know what I'm doing wrong! Regards, Pete