diff options
author | David Robillard <d@drobilla.net> | 2018-08-04 19:21:56 +0200 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2018-08-07 20:01:10 +0200 |
commit | daa750c18da7a18bdccc357cbde993a8441716d9 (patch) | |
tree | 9dcb02105c19b7b7e92441bd3388d91bb6feac07 | |
parent | 2b7dd9b0b101f957a5f4787857a78df8c6031bf4 (diff) | |
download | chilbert-daa750c18da7a18bdccc357cbde993a8441716d9.tar.gz chilbert-daa750c18da7a18bdccc357cbde993a8441716d9.tar.bz2 chilbert-daa750c18da7a18bdccc357cbde993a8441716d9.zip |
Use static_assert
-rw-r--r-- | Hilbert/FixBitVec.hpp | 13 |
1 files 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<<n)-1) #define FBVMOD(i,m) if((i)>=(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; }; |