diff --git a/include/bx/bx.h b/include/bx/bx.h index 86449a2..7ad7322 100644 --- a/include/bx/bx.h +++ b/include/bx/bx.h @@ -23,17 +23,13 @@ #define BX_IGNORE_C4127(_x) bx::ignoreC4127(!!(_x) ) /// -#define BX_ENABLED(_x) bx::isEnabled() +#define BX_ENABLED(_x) (bx::isEnabled::value) namespace bx { constexpr int32_t kExitSuccess = 0; constexpr int32_t kExitFailure = 1; - /// Template for avoiding MSVC: C4127: conditional expression is constant - template - constexpr bool isEnabled(); - /// template constexpr bool isTriviallyCopyable(); diff --git a/include/bx/inline/bx.inl b/include/bx/inline/bx.inl index b54e8dd..1cf53a5 100644 --- a/include/bx/inline/bx.inl +++ b/include/bx/inline/bx.inl @@ -15,17 +15,12 @@ namespace bx template char(&CountOfRequireArrayArgumentT(const Ty(&)[Num]))[Num]; - template - BX_FORCE_INLINE constexpr bool isEnabled() + template + struct isEnabled { - return true; - } - - template<> - BX_FORCE_INLINE constexpr bool isEnabled() - { - return false; - } + // Template for avoiding MSVC: C4127: conditional expression is constant + static constexpr bool value = B; + }; inline constexpr bool ignoreC4127(bool _x) {