Boost logo

Boost Users :

From: Elisha Berns (e.berns_at_[hidden])
Date: 2005-07-15 12:40:59

Thanks Joaquin,

Your code worked perfectly and probably sped up the application by a
factor of 3. One thing though, out of curiosity, what kind of container
does Boose.MultiIndex use internally? And is there any way to further
optimize Boost.MultiIndex by specifying what type of container is used


> Hi Elisha, maybe Boost.MultiIndex can help here.
> First, what you want cannot be implemented with a standard set, since
> criterium used to allow elements into the container does not obey to
> equivalence relationship. Instead, you can set up a multi-index
> with two indices, one for each member of the pair. Insertion of a new
> element
> is then granted if there's no equivalent element for at least one of
> indices.
> Please find attached a minimal wrapper over a multi_index_container
> implementing this policy (tested with GCC 3.2/Boost 1.32) Note that
> first
> index is based on a composite key rather than the bare first member of
> pair,
> so as to be able to provide standard lookup functions (exemplified by
> berns_container::find.)
> Hope this helps, best regards,
> Joaquín M López Muñoz
> Telefónica, Investigación y Desarrollo

Boost-users list run by williamkempf at, kalb at, bjorn.karlsson at, gregod at, wekempf at