|
Boost : |
From: Howard Hinnant (hinnant_at_[hidden])
Date: 2007-12-12 12:08:43
On Dec 12, 2007, at 8:25 AM, David Abrahams wrote:
>
> on Tue Dec 11 2007, Ion Gaztañaga <igaztanaga-AT-gmail.com> 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.
I can open an issue, but I'm not understanding why the "Unless
otherwise specified" in [container.requirements]/10 doesn't give us
what we want. [unord.req.except]/11 "otherwise specifies":
> No erase() function throws an
> exception unless that exception is thrown by the containers Hash or
> Pred object (if any).
This really seems NAD to me.
-Howard
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk