Boost logo

Boost :

From: David Abrahams (dave_at_[hidden])
Date: 2007-12-12 08:25:12

on Tue Dec 11 2007, Ion Gaztañaga <> wrote:

> David Abrahams wrote:
>>> so the predicate for associative container should not throw, because
>>> erase(const key_type &k) can't throw.
>> They're unrelated.
> So the exception specification for that erase version is missing. I
> thought that erase(const key_type &) was allowed to throw, but "no
> erase(), pop_back() or pop_front() function throws an exception" seems
> quite generic. If "erase()" means "erase(iterator)" I think it would be
> nice to clarify it and explicitly state if the Comparison function is
> allowed to throw.
> Just my 2 cents,

I think you're right. This looks like a defect to me.
Howard: my suggested resolution is to say, for erase(key_type const&),
no exception is thrown other than by the comparison function.

Dave Abrahams
Boost Consulting

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