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 for the latest Boost documentation.
PrevUpHomeNext

Macro BOOST_CONTRACT_STATIC_INVARIANT_FUNC

BOOST_CONTRACT_STATIC_INVARIANT_FUNC — Define the name of the static invariant member function (static_invariant by default).

Synopsis

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

BOOST_CONTRACT_STATIC_INVARIANT_FUNC

Description

This macro expands to the name of the static member function that checks static class invariants:

class u {
    friend class boost::contract::access;

    static void BOOST_CONTRACT_STATIC_INVARIANT_FUNC() {
        BOOST_CONTRACT_ASSERT(...);
        ...
    }

    ...
};

Users can redefine this macro if the static invariant function must have a name different from static_invariant (because of name clashes in user code, etc.).

[Note] Note

C++ does not allow to overload member functions based on the static classifier, so this macro must always be defined to be different than the function name defined for BOOST_CONTRACT_INVARIANT_FUNC.

See Also:

Class Invariants


PrevUpHomeNext