3 #ifndef DUNE_STATIC_ASSERT_HH
4 #define DUNE_STATIC_ASSERT_HH
16 #if not HAVE_STATIC_ASSERT
26 #define CPPMAGIC_JOIN( X, Y ) CPPMAGIC_DO_JOIN( X, Y )
27 #define CPPMAGIC_DO_JOIN( X, Y ) CPPMAGIC_DO_JOIN2(X,Y)
28 #define CPPMAGIC_DO_JOIN2( X, Y ) X ## Y
30 template <
bool x>
struct static_assert_failure;
32 template <>
struct static_assert_failure<true> { };
34 template<
int x>
struct static_assert_test {};
75 #if HAVE_STATIC_ASSERT
76 #define dune_static_assert(COND,MSG) \
77 static_assert(COND,MSG)
79 #define dune_static_assert(COND,MSG) \
80 typedef static_assert_test< \
81 sizeof(static_assert_failure< (bool)( COND )>)\
82 > CPPMAGIC_JOIN (dune_static_assert_typedef_, __LINE__)
static const bool value
always a false value
Definition: static_assert.hh:129
static const bool value
always a true value
Definition: static_assert.hh:142
Dune namespace.
Definition: alignment.hh:14
template which always yields a false value
Definition: static_assert.hh:127
template which always yields a true value
Definition: static_assert.hh:140