Boost logo

Boost :

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


>>>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 :-)


Boost list run by bdawes at, gregod at, cpdaniel at, john at