Namespaces | |
hpp | |
Macros | |
#define | HPP_ASSERT(CONDITION) |
Define HPP_ASSERT. More... | |
#define | HPP_PRECONDITION(CONDITION) HPP_ASSERT (CONDITION) |
Define macro for precondition checking. More... | |
#define | HPP_POSTCONDITION(CONDITION, CAPTURED_VARIABLES) |
Define macro for postcondition checking. More... | |
Functions | |
hpp::HPP_MAKE_EXCEPTION (HPP_UTIL_DLLAPI, AssertionError) | |
#define HPP_ASSERT | ( | CONDITION | ) |
Define HPP_ASSERT.
Throw an ::hpp::AssertionError if macro argument evaluates to false.
#define HPP_POSTCONDITION | ( | CONDITION, | |
CAPTURED_VARIABLES | |||
) |
Define macro for postcondition checking.
This macro allows an assertion to be done whenever a scope is exited.
This macro takes two arguments: the condition which should be evaluated and a list of captured variables. All variables used in the condition must be in this list.
They can either be copied or taken by reference: HPP_POSTCONDITION (a == 3, (a)) ...checks that a is equal to three and copy the variable a when HPP_POSTCONDITION is called.
HPP_POSTCONDITION (a == 3, (&a)) ...takes a by reference and evaluated its final value (when the scope is exited).
See Boost.ScopeExit for more details.
#define HPP_PRECONDITION | ( | CONDITION | ) | HPP_ASSERT (CONDITION) |
Define macro for precondition checking.