Boost logo

Boost Users :

From: Rene Tarantino (rene4jazz_at_[hidden])
Date: 2006-07-28 15:49:49


Hi :

I'm just starting to use boost utility library and it seems very promising.
I am trying to define a new multi_index type and gcc it's giving me error
messages.

First I properly added the includes for boost::multi_index :

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

then the includes for "Item" and "ObjectId" declarations:

#include "Item.h"

following that appears this:

typedef multi_index_container<
          Item*,
          indexed_by<
            hashed_unique<mem_fun<Item, ObjectId, &Item::getId> >
>
> ItemsContainer;

When I try to compile this code gcc reports the following errors:

error: 'mem_fun' was not declared in this scope
error: template argument 1 is invalid
error: type/value mismatch at argument 3 in template parameter list for
'template<class Arg1, class Arg2, class Arg3, class Arg4> struct
boost::multi_index::hashed_unique'
error: expected a type, got '&emedia::lumiere::Item::getId'
error: template argument 1 is invalid
error: template argument 2 is invalid
error: expected unqualified-id before '>' token

It seems that I'm forgetting something. It's very strange because I all
ready compilled this code in another project but I can't find any difference
with this one.

Any idea.

Thanks in advance.

René



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