From daa750c18da7a18bdccc357cbde993a8441716d9 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Sat, 4 Aug 2018 19:21:56 +0200 Subject: Use static_assert --- Hilbert/FixBitVec.hpp | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/Hilbert/FixBitVec.hpp b/Hilbert/FixBitVec.hpp index 0efd889..7708064 100644 --- a/Hilbert/FixBitVec.hpp +++ b/Hilbert/FixBitVec.hpp @@ -38,8 +38,6 @@ typedef uint64_t FBV_UINT; #define FBVN1S(n) (n==FBV_BITS?FBV1S:(FBV1<=(m))(i)-=(m)*((i)/(m)); -#define COMPILE_TIME_ASSERT(pred) switch(0){case 0:case pred:;} - enum EBitVecType { eFix, @@ -523,14 +521,9 @@ public: } private: - - static void - compileTimeAssertions() - { - COMPILE_TIME_ASSERT( 8*sizeof(FBV_UINT) == FBV_BITS ); - COMPILE_TIME_ASSERT( (sizeof(FBV_UINT) == 4) || (sizeof(FBV_UINT) == 8) ); - } - + static_assert( 8*sizeof(FBV_UINT) == FBV_BITS, "" ); + static_assert( (sizeof(FBV_UINT) == 4) || (sizeof(FBV_UINT) == 8), "" ); + FBV_UINT m_uiRack; }; -- cgit v1.2.1