mirror of
https://github.com/ETLCPP/etl.git
synced 2026-10-28 18:07: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)
|
#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
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user