Boost logo

Boost :

From: Martin Knoblauch Revuelta (mkrevuelta_at_[hidden])
Date: 2006-10-26 13:11:27


On 10/26/06, Jason Hise <0xchaos_at_[hidden]> wrote:
> [..]
> Out of curiosity, since I didn't see it mentioned in previous posts
> (maybe I'm blind and missed it)... What operations on the container
> cause existing iterators to be invalidated?

Only deletion of the refereced element, or destruction of the whole container.
Iterators referencing end() are only invalidated when the container is
destroyed.

Other operations, like moving elements, sorting the array, merging,
swapping... don't invalidate iterators, because the tree nodes are
never moved in memory. Iterators contain only a simple pointer to a
node. Nothing but the node itself ties them to a concrete container.
That's why many methods have been declared static.

Regards,

Martin Knoblauch Revuelta


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk