#include <cstdlib>
Go to the source code of this file.
Classes | |
| class | Asserter |
| Base class to handle assertions. More... | |
| class | AsserterEx< E > |
| Derived class to handle templated assertions with support for throwing exceptions. More... | |
Defines | |
| #define | ASSERT |
| smarter version of the assert macro | |
Enumerations | |
| enum | AsserterAction |
| The action chosen by the user after an assertion fires. | |
Functions | |
| AsserterAction | AskUser (const char *file, int line, const char *msg=NULL) |
| A function to ask the user what to do when an assertion fires. | |
This Code was originally written by Andrei Alexandrescu in his C/C++ Users Journal article "Assertions", April 2003. I have modified it slightly to work with g++ 4.0 and Fountain concepts
|
|
Value: if (false); \ else \ struct Local {\ Local(const Asserter& info) { info.Handle(__FILE__, __LINE__); }\ } localAsserter = Asserter::Make The purpose of using this macro is to allow the programmer a more robust method of catching errors during the debug phase of a project. When compiled for production use, meaning the NDEBUG macro is defined, this macro evaluates to if (true); |
|
||||||||||||||||
|
A function to ask the user what to do when an assertion fires.
|
1.4.6