Boost logo

Boost Users :

From: Joaquín Mª López Muñoz (joaquin_at_[hidden])
Date: 2006-02-07 11:08:58


Hello Aashit,

"Soni, Aashit" ha escrito:

> Hi all,
>
> I am newbie to Boost library. I am trying to use multi_index_container
> library in my project. The problem I have at my hands needs One Hash
> index and one ordered indexed. I refer the Boost tutorial and Advance
> topic and tried to write the following snippet. But when I compiled it
> gives compilation error. I searched lot of different options and tried
> to fix it but I could not able to do it so.
>
> If you can guide me how to shut the compilation errors it will be
> great. If anyone of you is having any decent example tried out for
> Hash having ordered indexes please send it to me so I can go through
> and build my logic on top of that….
>
> Code Follows.
>
> I am using MSVC SP6 on Win XP .

This is primarily the problem: To make MSVC 6.0 compile a program
using Boost.MultiIndex you've got to observe some stricter rules than
in the normal case. Please read the section on MSVC 6.0 at

http://boost.org/libs/multi_index/doc/compiler_specifics.html#msvc_60

> typedef employee_set::index<employee_set,ssnumber>::type
> employee_set_by_ssn;

Problem #1: MSVC 6.0 does not support the "index" nested typedef.
Instead, write

        typedef index<employee_set,ssnumber>::type employee_set_by_ssn;

> employee_set_by_ssn& ssn_index=es.get<2>();

Problem #2: MSVC 6.0 does not support the get member function, use the
global
version instead:

        employee_set_by_ssn& ssn_index=get<2>(es);

With these changes, and also tweaking /Zm and /ZI (as explained in the
aforementioned section), your program compiles. Bare in mind that your
compiler is very old and broken and making Boost.MultiIndex work for it
can be quite a challenge, although it is doable. Good luck with your
project,

Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo



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