Boost C++ Libraries Home Libraries People FAQ More

PrevUpHomeNext

Macro BOOST_CONTRACT_PRECONDITIONS_DISABLE_NO_ASSERTION

BOOST_CONTRACT_PRECONDITIONS_DISABLE_NO_ASSERTION — Define this macro to not disable other assertions while checking preconditions (undefined by default).

Synopsis

// In header: <boost/contract/core/config.hpp>

BOOST_CONTRACT_PRECONDITIONS_DISABLE_NO_ASSERTION

Description

Not disabling other assertions while checking preconditions can lead to infinite recursion in user code so by default this macro is not defined.

However, the [N1962] proposal does not disable assertions while checking preconditions because arguments can reach the function body unchecked if assertions are disabled while checking preconditions (e.g., when these same functions bodies are called to check the preconditions in question). This macro can be defined to obtain the behaviour specified in [N1962] (at the risk of infinite recursion).

See Also:

Feature Summary


PrevUpHomeNext