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 an old version of Boost. Click here to view this page for the latest version.
PrevUpHomeNext

Macro BOOST_CONTRACT_INVARIANT

BOOST_CONTRACT_INVARIANT — Program (constant) class invariants that can be completely disabled at compile-time.

Synopsis

// In header: <boost/contract_macro.hpp>

BOOST_CONTRACT_INVARIANT(...)

Description

BOOST_CONTRACT_INVARIANT({ ... }) expands to code equivalent to the following (note that no code is generated when BOOST_CONTRACT_NO_INVARIANTS is defined):

#ifndef BOOST_CONTRACT_NO_INVARIANTS
    void BOOST_CONTRACT_INVARIANT_FUNC() const {
        ...
    }
#endif

Where:

See Also:

Disable Contract Compilation, Class Invariants


PrevUpHomeNext