Boost logo

Boost Users :

Subject: Re: [Boost-users] [containers] defining the insertion point of non-unique keys
From: joaquin_at_[hidden]
Date: 2009-12-18 08:25:00

Olaf Krzikalla escribió:
> Hi @boost,
> I'm looking for the solution to the following problem:
> there is a collection of objects and I want to find a particular object
> by two different keys. The first key is unique, so there is no problem.
> The second key however is non-unique and if I search for an object using
> this key I want to find the element that was inserted last in that
> sequence. Neither boost::multindex nor boost:intrusive seems to have
> solutions right at hand. If using boost::multindex I could try to insert
> a new element in the non-unique sequence using the lower_bound
> iterator of that sequence as a hint. However it is not documented that
> in that case the element is always inserted before the hint. [...]

Hi Olaf,

Starting with Boost 1.35, Boost.MultiIndex ordered indices guarantee
that hinted
insertion takes place as close as possible to the hint, please take a
look at .

But you're right this is not stated in the docs. I'll change that. It'd
help if you can file
a ticket for the issue so that I don't forget.

Thank you,

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