Boost logo

Boost :

Subject: Re: [boost] Feed pointers to a container, however use the member of the data type which pointer refer to
From: joaquin_at_[hidden]
Date: 2009-09-22 03:06:10

Hi, please refer to the name of the lib your post's about in the post's
line, like this: [multi_index].

路 邓 escribió:
> Dear All:
> In the following codes, I feed the container with B*, however
> I user the member of B as the index. Can somebody explain to
> me how this work out? And It seems that if smart pointers
> are feeded into the container, it still works out.
> [...]
> typedef boost::multi_index_container<
> B*,
> indexed_by<
> ordered_unique<
> >
> >
>> Container;

Yep, this is a feature provided by Boost.MultiIndex predefined key
to help users dealing with pointers and pointer-like elements, as
explained in

What's your particular concenr about this? Are you just puzzled that this
works out of the box, or are you interested in the internal mechanisms used
to implement the feature?

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

Boost list run by bdawes at, gregod at, cpdaniel at, john at