mirror of
https://github.com/bkaradzic/bx.git
synced 2026-02-17 20:52:37 +01:00
Fixed issue #236.
This commit is contained in:
@@ -23,17 +23,13 @@
|
||||
#define BX_IGNORE_C4127(_x) bx::ignoreC4127(!!(_x) )
|
||||
|
||||
///
|
||||
#define BX_ENABLED(_x) bx::isEnabled<!!(_x)>()
|
||||
#define BX_ENABLED(_x) (bx::isEnabled<!!(_x)>::value)
|
||||
|
||||
namespace bx
|
||||
{
|
||||
constexpr int32_t kExitSuccess = 0;
|
||||
constexpr int32_t kExitFailure = 1;
|
||||
|
||||
/// Template for avoiding MSVC: C4127: conditional expression is constant
|
||||
template<bool>
|
||||
constexpr bool isEnabled();
|
||||
|
||||
///
|
||||
template<class Ty>
|
||||
constexpr bool isTriviallyCopyable();
|
||||
|
||||
@@ -15,17 +15,12 @@ namespace bx
|
||||
template<typename Ty, size_t Num>
|
||||
char(&CountOfRequireArrayArgumentT(const Ty(&)[Num]))[Num];
|
||||
|
||||
template<bool>
|
||||
BX_FORCE_INLINE constexpr bool isEnabled()
|
||||
template<bool B>
|
||||
struct isEnabled
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
template<>
|
||||
BX_FORCE_INLINE constexpr bool isEnabled<false>()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
// Template for avoiding MSVC: C4127: conditional expression is constant
|
||||
static constexpr bool value = B;
|
||||
};
|
||||
|
||||
inline constexpr bool ignoreC4127(bool _x)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user