Boost logo

Boost Users :

Subject: [Boost-users] Getting multi_index_container in 1.46.1 to work with VC++ 6.0
From: tangleman_at_[hidden]
Date: 2011-05-05 15:56:58


I've got a legacy MFC project that was built in VC++ 6.0. It needs to
stay compatible with VC6 runtime so that I can just drop it into Windows
NT4 where the original program was and have it just work. I've finally
gotten MFC and VC6 runtime to play nice in VS2003. Now I'm trying to work
in boost libraries so that I can use the ethernet and serial aspects of
ASIO. Of course, I downloaded and am working with the latest version of
boost (1.46.1), and I have it to the point where 311 errors are reported
at compile time, all having to do with multi_index_container. I've looked
through the compiler specifics pages of the 1.46.1 and 1.45.0 releases
with respect to the multi_index and have made the workaround changes that
I could (i.e. member->member_offset,
boost::multi_index::multi_index_container), but I am still getting syntax
errors related to the typedef of my multi_index_container.

If it will help, here is my definition:

struct ID{};
struct Name{};

typedef boost::multi_index::multi_index_container<
    PDCUTestMessage,
    boost::multi_index::indexed_by<
        boost::multi_index::ordered_unique<
            boost::multi_index::tag<ID>,
            boost::multi_index::member_offset<PDCUTestMessage, unsigned
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;

The first error I'm getting is a syntax error calling out the comma on the
line with member_offset PDCUTestMessage id. Then, since that doesn't
compile, subsequent error messages snowball for every time I instantiate
PDCUTestMessage and every time I add to the multi_index_container.

Please help as soon as possible. I'm on a tight schedule, and this is the
only major hurdle I see at this point.

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