mirror of
https://github.com/ETLCPP/etl.git
synced 2026-04-30 19:09:10 +08:00
Modified static assert macros
This commit is contained in:
parent
0c6785e25f
commit
431fe7bd8e
@ -32,13 +32,13 @@ SOFTWARE.
|
||||
#elif defined(COMPILER_GCC)
|
||||
#define STATIC_ASSERT(Condition, Message) static_assert(Condition, Message)
|
||||
#else
|
||||
template <bool Condition, const char* Message>
|
||||
template <bool Condition>
|
||||
struct STATIC_ASSERTION_FAILURE;
|
||||
|
||||
template <const char* Message>
|
||||
struct STATIC_ASSERTION_FAILURE<true, Message> {};
|
||||
template <>
|
||||
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
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user