|
Boost Users : |
Subject: Re: [Boost-users] [multi_index and flyweight]
From: Samuel Charron (samuel.charron_at_[hidden])
Date: 2009-12-08 18:17:44
On Tue, Dec 8, 2009 at 9:01 PM, Joaquin M Lopez Munoz <joaquin_at_[hidden]> wrote:
>
> Ok, now I got it. The short ansewer is that Boost.MultiIndex
> does not provide any off-the-shelf way to do what you want,
> basically because each element (each vector in your case)
> appears exactly once in any given index.
>
> Long answer: you can approach your scenario by storing
> "container positions" rather than containers and manually
> inserting for each new conainer as many different positions
> as elements has the container. Kind of as sketched in the
> following program:
>
> <code snippet>
>
> Is this what you're after?
>
> JoaquÃn M López Muñoz
> Telefónica, Investigación y Desarrollo
Yes that's it.
I tried something similar, using boost::flyweight (hence my question
about scoped flyweights).
I tried to write another kind of index for BMI some time ago, and if
I remember correctly, there is no way to map an element to multiple
values of an index. Do you think of anything to point into the code of
BMI to try doing it ?
Do you have any kind of documentation about writing an index for BMI
(to be sure what I'm writing is safe) ?
Thanks for this library !
Samuel
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