Re: [Boost-users] [multi_index] - iterator validity?
----- Mensaje original -----
De: Stuart Dootson
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
On 8/9/05, JOAQUIN LOPEZ MU?Z
----- Mensaje original ----- De: Stuart Dootson
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
Thanks - that's exactly what I wanted. Just one thing - this statement doesn't appear to be made generally for sequenced indices, just for certain methods (that's in the 1.33 RC2 documentation). Stuart Dootson
participants (2)
-
JOAQUIN LOPEZ MU?Z
-
Stuart Dootson