Boost C++ Libraries

...one of the most highly regarded and expertly designed C++ library projects in the world. Herb Sutter and Andrei Alexandrescu, C++ Coding Standards

This is the documentation for a snapshot of the master branch, built from commit 97da996172.
PrevUpHomeNext

Macro BOOST_CONTRACT_ASSERT_AXIOM

BOOST_CONTRACT_ASSERT_AXIOM — Preferred way to document in the code contract conditions that are computationally prohibitive, at least compared to the computational cost of executing the function body.

Synopsis

// In header: <boost/contract/assert.hpp>

BOOST_CONTRACT_ASSERT_AXIOM(cond)

Description

The asserted condition will always be compiled and validated syntactically, but it will never be checked at run-time. This macro is defined by code equivalent to:

#define BOOST_CONTRACT_ASSERT_AXIOM(cond) \
    BOOST_CONTRACT_ASSERT(true || cond)

BOOST_CONTRACT_ASSERT, BOOST_CONTRACT_ASSERT_AUDIT, and BOOST_CONTRACT_ASSERT_AXIOM are the three assertion levels predefined by this library. If there is a need, programmers are free to implement their own assertion levels defining macros similar to the one above.

See Also:

Assertion Levels, No Macros

Parameters:

cond

Boolean contract condition to check. (This is not a variadic macro parameter so any comma it might contain must be protected by round parenthesis and BOOST_CONTRACT_ASSERT_AXIOM((cond)) will always work.)


PrevUpHomeNext