Boost logo

Boost :

Subject: [boost] [Review:Contract] Contract Broken Handlers , BOOST_NO_EXCEPT and noexcept
From: Vicente J. Botet Escriba (vicente.botet_at_[hidden])
Date: 2012-08-29 19:52:47


Hi,

I would like to know if Boost.Contract could work when BOOST_NO_EXCEPT
is defined. I suspect that it can not at present, as the user needs to
re-throw the exception to know the broken nature. Maybe the handler
could have the an exception/error object as parameter instead.

In order to be able to use contracts in C++11 functions declared
noexcept I would need that the contract handler are declared noexcept
also, in particular when the contract is broken from a destructor, which
is often declared noexcept in C++11.
Maybe the library can provide some specific set handlers that expect a
noexcept handler for the destructor context.

BTW, could the ALL CAPITAL |FROM_CONSTRUCTOR, ... enumeration literal|s
be renamed to lower case from_constructor, ...?

Best,
Vicente


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