Templates -- Meow  2.0.-1
A C++ template contains kinds of interesting classes and functions
assert.h File Reference

Contains assert macro for meowpp's debugging tools. More...

#include <cstdio>
#include <cstdlib>

Go to the source code of this file.

Namespaces

 meow
 

Macros

#define MEOWPP_STRINGIFY(x)   #x
 
#define MEOWPP_TOSTRING(x)   MEOWPP_STRINGIFY(x)
 
#define Assert(expr,...)
 A macro for assert whether a expression is failed or not. More...
 

Detailed Description

Contains assert macro for meowpp's debugging tools.

You can use

#define MEOWPP_NODEBUG

to remove all the debugging code.

Author
cathook

Definition in file assert.h.

Macro Definition Documentation

#define Assert (   expr,
  ... 
)
Value:
while (((expr) || \
(fprintf(stderr, "Assertion error at " \
__FILE__ ":" MEOWPP_TOSTRING(__LINE__) \
" >>>" __VA_ARGS__), \
abort(), false)) && false)
#define MEOWPP_TOSTRING(x)
Definition: assert.h:45

A macro for assert whether a expression is failed or not.

Parameters
exprThe expression to be tested.
...Error information to be printed to stderr when the expr is failed.

When expression is failed, it will call fprintf(stderr, ...) to print out the message follows by calling abort() to halt the program.

Note
You can use
#define MEOWPP_TESTING
to tell this macro calls test::abort() instead of normal abort() function.

Definition at line 49 of file assert.h.

#define MEOWPP_STRINGIFY (   x)    #x

Definition at line 44 of file assert.h.

#define MEOWPP_TOSTRING (   x)    MEOWPP_STRINGIFY(x)

Definition at line 45 of file assert.h.