Boost logo

Boost Users :

From: Jeff F (TriumphSprint2000_at_[hidden])
Date: 2006-12-08 08:29:36


"fungos" <fungos_at_[hidden]> wrote in message
news:e763e59d0612080512k4f02b88cnee2732030a95a5ff_at_mail.gmail.com...
Well, I still having trouble to get mem_fun working. multi_index accept
boost mem_fn?
Joaquin, the const still wont work. I stripped down the sample to this code:

[code]

#include <boost/multi_index_container.hpp>
#include <boost/multi_index/mem_fun.hpp>
#include <boost/multi_index/ordered_index.hpp>

using boost::multi_index_container;
using namespace ::boost::multi_index;

class Entry
{
        private:
                int size;
        public:
                Entry(int s) : size(s) {}
                int getSize() const { return size; }
};

typedef multi_index_container<
        Entry,
        indexed_by<
                ordered_non_unique<BOOST_MULTI_INDEX_MEM_FUN(Entry,
int, getSize) > // line 23

Doesn't this work?

    ordered_non_unique< const_mem_fun<Entry,int,&Entry::getSize>
>
>

> EntryCollection;

void main() {
        EntryCollection entries;
        Entry a(3);
        entries.insert(a); // line 33
}

Jeff Flinn


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net