Boost logo

Boost Users :

From: JOAQUIN LOPEZ MU?Z (joaquin_at_[hidden])
Date: 2005-08-09 06:54:26


----- Mensaje original -----
De: Stuart Dootson <stuart.dootson_at_[hidden]>
Fecha: Martes, Agosto 9, 2005 11:01 am
Asunto: [Boost-users] [multi_index] - iterator validity?

> Hi - I've just started using multi_index. I'm wondering - does
> multi_index satisfy the same iterator validity constraints as the
> standard associative containers, i.e:
>
> The insert members shall not affect the validity of iterators and
> references to the container, and the erase members shall invalidate
> only iterators and references to the erased elements.
>
> I *have* looked in the documentation, but haven't been able to find
> anything which tells me.
>

This guarantee (stability) is held for all types of indices
--ordered, sequenced and hashed (the last case is not so obvious, as
TR1 does not require hashed containers to be stable.)

There is no statement on the docs ensuring that
multi_index_containers are stable because this is not a property
of the container, but rather of each particular type of
index: conceivably, a future index type may not guarantee
stability for whatever reason, though currently this is not the
case.
So, you can see stability is referred to in the reference
section of each type of index. For instance, for ordered indices
stability is (succintly) stated in

http://boost.org/libs/multi_index/doc/reference/ord_indices.html#ord_in
dices

Does this clear things up for you?

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