Boost logo

Boost :

Subject: Re: [boost] [Contract] noexcept and custom contract violation handlers
From: Sebastian Redl (sebastian.redl_at_[hidden])
Date: 2012-09-03 03:54:05


On 02.09.2012 21:40, Andrzej Krzemienski wrote:
> 2012/9/2 Dave Abrahams <dave_at_[hidden]>
>
>> This is bad advice and should be ignored. Exceptions and
>> preconditions have no inherent relationship, exceptions are not a
>> good tool for handling precondition failures, and nothing should be
>> done to link them.
> I agree in principle; however, N3248 provides one example that cannot be
> that quickly dismissed: testing if your library defined (and verified)
> enough preconditions.
googletest, just as an example, provides death tests. Set Contract to
terminate on violation (as it should) and run them.

Sebastian


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