Boost logo

Boost :

From: Daniel James (daniel_james_at_[hidden])
Date: 2007-12-11 14:00:39


Joaquín Mª López Muñoz wrote:
> I think unordered containers are *not* allowed to rehash when erasing:
> see N2461, 23.1.3/8
>
> "...Rehashing invalidates iterators, changes ordering between elements,..."
>
> and 23.1.3/12
>
> "...The erase members shall invalidate only iterators and references
> to the erased elements."
>
> so the conclusion is that erase can't rehash (incidentally, the implications of
> rehashing when erasing a range would be difficult to cope with).
>

If a container implemented a rehash which doesn't invalidate iterators
(which is certainly possible, if unlikely) then could it rehash? (Of
course, such a container would have to maintain the order of the elements).

Daniel


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