Boost logo

Boost :

From: Joshua Moore-Oliva (josh_at_[hidden])
Date: 2006-12-30 18:16:07


Sorry if you get this twice, it didn't post for me on the first try.

I was doing what I do regularly with std::maps... a
m_plsts.erase( m_plsts.begin(), m_plsts.end() ); on a boost::ptr_map. It
failed with an assertion error... Digging around, it came from
ptr_container/detail/associative_ptr_container.hpp on line 117. It appears
that every single erase (including that done by a key) has an assert for the
map not being empty!

Why is this the case? As far as I understand, it is valid to attempt to
remove a key that does not exist. It follows that the same behaviour would
occur whether the map was empty or not. Attempting to remove an element from
an empty map should not result in an abort.

If I'm unaware of some C++ convention I would love to be informed, however
this definitely screams bug to me.

Joshua Moore-Oliva


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