|
Classes |
| struct | DefaultPredicate |
| | Default predicate tester for the Enforcer class, tests values against 0 using the ! operator. More...
|
| struct | DefaultRaiser |
| | Default raiser for the Enforcer class, throws a FountainException using the message and locus as the descriptive text. More...
|
| struct | ErrorPredicate |
| | Predicate tester for the Enforcer class, tests values against FAILURE using the equality operator. More...
|
| class | Enforcer< Ref, P, R > |
| | This class is intended to be used as a runtime version of the assert macro. More...
|
Defines |
| #define | STRINGIZE(expr) STRINGIZE_HELPER(expr) |
| #define | STRINGIZE_HELPER(expr) #expr |
| #define | ENFORCE(exp) *MakeEnforcer<DefaultPredicate, DefaultRaiser>((exp), "Expression '" #exp "' failed in '" __FILE__ "', line: " STRINGIZE(__LINE__)) |
| #define | ENFORCE_SUCCESS(exp) *MakeEnforcer<ErrorPredicate, DefaultRaiser>((exp), "Expression '" #exp "' failed in '" __FILE__ "', line: " STRINGIZE(__LINE__)) |
Functions |
| template<class P, class R, typename T> |
| Enforcer< const T &, P, R > | MakeEnforcer (const T &t, const char *locus) |
| | Inline function to create an Enforcer object.
|
|
template<class P, class R, typename T> |
| Enforcer< T &, P, R > | MakeEnforcer (T &t, const char *locus) |
| | Overloaded version of MakeEnforcer for non-const objects.
|
This Code was originally written by Andrei Alexandrescu and Petru Marginean in their C/C++ Users Journal article "Enforcements", June 2003. I have modified it slightly to work with g++ 4.0 and Fountain concepts