Boost logo

Boost :

From: Thorsten Ottosen (thorsten.ottosen_at_[hidden])
Date: 2007-01-03 08:28:29


JOAQUIN LOPEZ MU?Z wrote:

>>>is conformig. The rational is that erase(end()) is illegal, or
>>>at least undefined behavior, in STL containers.
>>
>>Is it? I couldn't easily deduce that from the standard.
>
>
> If you go to 23.1.2/7 where a table is given with requirements
> for associative containers, the expression "a.erase(q)" involves
> the iterator q, which is previously defined to represent a
> valid *dereferenceable* iterator to a --and end() is not
> dereferenceable. Analogous conditions are present for sequence
> containers.

Thanks. So obvious :-)

-Thorsten


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