cgv
Loading...
Searching...
No Matches
assert.h
1
#pragma once
2
3
#include <cgv/defines/join.h>
4
5
namespace
cgv
{
6
namespace
defines {
7
8
template
<
bool
x>
struct
STATIC_ASSERTION_FAILURE
;
9
template
<>
struct
STATIC_ASSERTION_FAILURE
<true> {
enum
{ value = 1 }; };
10
template
<
int
x>
struct
static_assert_test
{};
11
12
}
13
}
14
15
#define CGV_DEFINES_ASSERT( ... ) \
16
typedef ::cgv::defines::static_assert_test<\
17
sizeof(::cgv::defines::STATIC_ASSERTION_FAILURE< (bool)( __VA_ARGS__ ) >)>\
18
CGV_DEFINES_JOIN(_static_assert_test_, __LINE__);
19
20
// use (void) to silence unused warnings
21
#define assertm(exp, msg) assert(((void)msg, exp))
cgv
this header is dependency free
Definition
print.h:11
cgv::defines::STATIC_ASSERTION_FAILURE
Definition
assert.h:8
cgv::defines::static_assert_test
Definition
assert.h:10
cgv
defines
assert.h
Generated by
1.9.8