Boost logo

Boost :

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


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
list 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