cgv
Loading...
Searching...
No Matches
assert.h
1#pragma once
2
3#include <cgv/defines/join.h>
4
5namespace cgv {
6 namespace defines {
7
8template <bool x> struct STATIC_ASSERTION_FAILURE;
9template <> struct STATIC_ASSERTION_FAILURE<true> { enum { value = 1 }; };
10template<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))
the cgv namespace
Definition print.h:11