Home | Libraries | People | FAQ | More |
BOOST_CONTRACT_INVARIANT_FUNC — Define the name of the class invariant member function (invariant
by default).
// In header: <boost/contract/core/config.hpp>
BOOST_CONTRACT_INVARIANT_FUNC
This macro expands to the name of the const
and const volatile
member functions that check class invariants and volatile class invariants respectively:
class u { friend class boost::contract::access; void BOOST_CONTRACT_INVARIANT_FUNC() const { BOOST_CONTRACT_ASSERT(...); ... } void BOOST_CONTRACT_INVARIANT_FUNC() const volatile { BOOST_CONTRACT_ASSERT(...); ... } ... };
When used this way, users can redefine this macro if the invariant functions must have a name different from invariant
(because of name clashes in user code, etc.).
Note | |
---|---|
C++ does not allow to overload member functions based on the |
See Also:
Class Invariants, Volatile Public Functions