Modified static assert macros

This commit is contained in:
jwellbelove 2014-12-08 20:30:12 +00:00
parent 0c6785e25f
commit 431fe7bd8e

View File

@ -32,13 +32,13 @@ SOFTWARE.
#elif defined(COMPILER_GCC) #elif defined(COMPILER_GCC)
#define STATIC_ASSERT(Condition, Message) static_assert(Condition, Message) #define STATIC_ASSERT(Condition, Message) static_assert(Condition, Message)
#else #else
template <bool Condition, const char* Message> template <bool Condition>
struct STATIC_ASSERTION_FAILURE; struct STATIC_ASSERTION_FAILURE;
template <const char* Message> template <>
struct STATIC_ASSERTION_FAILURE<true, Message> {}; struct STATIC_ASSERTION_FAILURE<true> {};
#define STATIC_ASSERT(Condition, Message) enum { assertdummy = sizeof(STATIC_ASSERTION_FAILURE<(bool)(Condition), Message>) } #define STATIC_ASSERT(Condition, Message) enum { assertdummy = sizeof(STATIC_ASSERTION_FAILURE<(bool)(Condition)>) }
#endif #endif
#endif #endif