Boost logo

Boost Users :

From: Joaquin M Lopez Munoz (joaquin_at_[hidden])
Date: 2005-04-05 07:17:59


Martin <adrianm <at> touchdown.se> writes:

>
> When compiling the following code on VC70
>
> struct tTest {
> tTest() : x(0), y(0), z(0)
> int x,y,z;
> };
>
> typedef multi_index_container<
> tTest,
> indexed_by<
> ordered_unique<
> composite_key<
> BOOST_MULTI_INDEX_MEMBER(tTest, int, x)
> ,BOOST_MULTI_INDEX_MEMBER(tTest, int, y)
> ) // replaced > with ) since gmane thinks I'm top-posting
> )
> )
> ) tTestList;
>
[...]

Hi Martin,

I haven't compiled your code, but I'm pretty confident
the problem lies in the following: instead of

       composite_key<
         BOOST_MULTI_INDEX_MEMBER(tTest, int, x)
        ,BOOST_MULTI_INDEX_MEMBER(tTest, int, y)
       )

you should write

       composite_key<
        tTest
        ,BOOST_MULTI_INDEX_MEMBER(tTest, int, x)
        ,BOOST_MULTI_INDEX_MEMBER(tTest, int, y)
       )

i.e. the first parameter of composite_key is the value
to which the extractors are applied. Please let me know
if that solves the issue.

Admittedly, the need for specifying the value in
composite_key seems a little redundant, and the error
messages don't help much, but there's no alternative
AFAICS.

Other than that, I'm always eager to get feedback
from users of the lib, so if you have additional comments
or suggestions please let me know.

Best,

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