Boost logo

Boost Users :

Subject: [Boost-users] Error C2039 using portable syntax for MultiIndex with Boost 1.34.1 on VC6
From: tangleman_at_[hidden]
Date: 2011-05-19 10:57:05


I am trying to use Boost Multi_Index from build 1.34.1 to set up a
collection of structs. This Multi Index container will have 2 unique keys
(ID and Name), since I have to be able to search it with either key. I
made the compiler-specific corrections for VC++ 6.0 SP5:

boost::multi_index::multi_index_container
member_offset<A,int,offsetof(A,x)>

My complete declaration is:

struct ID();
struct Name();

typedef boost::multi_index::multi_index_container<
    PDCUTestMessage,
    boost::multi_index::ordered_unique<
        boost::multi_index::tag<ID>,
        boost::multi_index::member_offset<PDCUTestMessage, char,
offsetof(PDCUTestMessage, id)> >,
    boost::multi_index::ordered_unique<
        boost::multi_index::tag<Name>,
        boost::multi_index::member_offset<PDCUTestMessage, string,
offsetof(PDCUTestMessage, name)> >
>
> PDCUMessageList;

Later, I attempt to set up indicies for both of these keys, according to
VC++ 6.0 compiler-specific syntax to bypass the Get/Tag issue:

typedef index<PDCUMessageList, ID>::type IDIndex;
typedef index<PDCUMessageList, Name>::type NameIndex;

Now the error.
using the above code, I get the following error:

error C2039: 'type': is not a member of "global namespace" referencing the
two typedef lines above.

I can't figure out what I am doing wrong?

Quick responses are much appreciated!

Thanks!
Chris


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