Boost logo

Boost :

From: Thomas Witt (witt_at_[hidden])
Date: 2007-01-02 11:26:52


Joshua Moore-Oliva wrote:
> 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!

Help me out here. The example does not work for m_plsts.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.

Sorry but how is this related to the above example?

Thomas

-- 
Thomas Witt
witt_at_[hidden]

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