Limbo 3.5.4
Loading...
Searching...
No Matches
AssertMsg.h File Reference

assertion with message More...

#include <iostream>
#include <limbo/preprocessor/Msg.h>

Go to the source code of this file.

Classes

struct  limbo::StaticAssert< true >
 template specialization More...

Namespaces

namespace  limbo
 namespace for Limbo

Macros

#define limboAssertMsg(condition, args...)
 custom assertion with message
#define limboAssert(condition)
 custom assertion without message
#define limboStaticAssert(condition)
 compile time assertion

Detailed Description

assertion with message

macro: limboAssertMsg, limboAssert

attribute: assertion with or without message. compared with assert in STL, it provides detailed information on the failures and positions

Author
Yibo Lin
Date
Nov 2014

Definition in file AssertMsg.h.

Macro Definition Documentation

◆ limboAssert

#define limboAssert ( condition)
Value:
do {\
if (!(condition)) \
{\
::limbo::limboPrintAssertMsg(#condition, __FILE__, __LINE__, __PRETTY_FUNCTION__); \
abort(); \
}\
} while (false)

custom assertion without message

example usage: limboAssert(a == 1);

Definition at line 36 of file AssertMsg.h.

◆ limboAssertMsg

#define limboAssertMsg ( condition,
args... )
Value:
do {\
if (!(condition)) \
{\
::limbo::limboPrintAssertMsg(#condition, __FILE__, __LINE__, __PRETTY_FUNCTION__, args); \
abort(); \
}\
} while (false)

custom assertion with message

example usage: limboAssertMsg(a == 1, "this is %s", name);

Definition at line 24 of file AssertMsg.h.

◆ limboStaticAssert

#define limboStaticAssert ( condition)
Value:
{\
limbo::StaticAssert<(condition) != 0>(); \
}

compile time assertion

Definition at line 59 of file AssertMsg.h.