|
Boost : |
From: Joshua Moore-Oliva (josh_at_[hidden])
Date: 2007-01-02 19:56:48
> My humble opinion is that you shouldn't allow an an end iterator
> to be legally passed to erase(iterator), that is, your current
Thinking about it, I would agree with you. I have some editing to do :D
However, the empty asserts were still in 1.33 on erase with a key, but that
issue seems to be resolved when the next boost comes out.
>
> BOOST_ASSERT( before != this->end() );
>
> is conformig. The rational is that erase(end()) is illegal, or
> at least undefined behavior, in STL containers.
>
> The additional check
>
> BOOST_ASSERT( !this->empty() );
>
> at the same member function is almost immaterial, since if
> the container is empty then end() is the only valid iterator
> that can be possibly passed in.
But it's still material for erase( key ).
Josh
>
> Best,
>
> Joaquín M López Muñoz
> Telefónica, Investigación y Desarrollo
> _______________________________________________
> Unsubscribe & other changes:
> http://lists.boost.org/mailman/listinfo.cgi/boost
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk