Boost logo

Boost :

From: David Abrahams (dave_at_[hidden])
Date: 2006-01-08 12:15:42


Daniel James <daniel_at_[hidden]> writes:

> Gennadiy Rozental wrote:
>>>It would be good to able to use my own exception types instead of
>>>Boost.Test's private exception type. You could possibly write a version
>>>of BOOST_ITEST_EPOINT which lets the user specify their own exception
>>>type, and some kind of mechanism to specify which exceptions are allowed
>>>seems essential.
>>
>>
>> Why would you need an ability to specify which fake exception to throw? This
>> facility tests namely this ability of your code to do unwinding properly in
>> case of any exception in any place.
>> You don't really need to know which exception it was. To check post
>> exception invariants you could use catch(...)
>
> Unordered associative containers have a few exception specifications
> like (from TR1 6.3.1.1/2):
>
> "For unordered associative containers, if an exception is thrown by
> any operation other than the container’s hash function from within an
> insert() function inserting a single element, the insert() function has
> no effect."

Careful with your terminology. In the standard, "exception
specification" means something else. Or at least,
"exception-specification" does.

-- 
Dave Abrahams
Boost Consulting
www.boost-consulting.com

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