diff --git a/crnlib/crn_assert.h b/crnlib/crn_assert.h index 152a6a19..8cd8250a 100644 --- a/crnlib/crn_assert.h +++ b/crnlib/crn_assert.h @@ -29,25 +29,7 @@ void crnlib_fail(const char* pExp, const char* pFile, unsigned line); void trace(const char* pFmt, va_list args); void trace(const char* pFmt, ...); -// Borrowed from boost libraries. -template -struct crnlib_assume_failure; -template <> -struct crnlib_assume_failure { - enum { blah = 1 }; -}; -template -struct crnlib_assume_try {}; - -#define CRNLIB_JOINER_FINAL(a, b) a##b -#define CRNLIB_JOINER(a, b) CRNLIB_JOINER_FINAL(a, b) -#define CRNLIB_JOIN(a, b) CRNLIB_JOINER(a, b) - -#ifdef NDEBUG -#define CRNLIB_ASSUME(p) -#else -#define CRNLIB_ASSUME(p) typedef crnlib_assume_try)> CRNLIB_JOIN(crnlib_assume_typedef, __COUNTER__) -#endif +#define CRNLIB_ASSUME(p) static_assert(p, "") #ifdef NDEBUG template