diff options
author | Andreas Schuh <andreas.schuh.84@gmail.com> | 2015-10-28 00:19:33 +0000 |
---|---|---|
committer | Andreas Schuh <andreas.schuh.84@gmail.com> | 2015-10-28 00:19:33 +0000 |
commit | 9db828953a1047c95bf5fb780c3c1f9453f806eb (patch) | |
tree | 67314847c05bb2453cebedaef5d1d97824332424 /src/util.h | |
parent | 4e61c45ef9b3321695a647003d6849d12cf161f8 (diff) | |
download | gflags-9db828953a1047c95bf5fb780c3c1f9453f806eb.tar.gz gflags-9db828953a1047c95bf5fb780c3c1f9453f806eb.tar.bz2 gflags-9db828953a1047c95bf5fb780c3c1f9453f806eb.zip |
#125 Fix unused typedef/variable warning for static assertion
Diffstat (limited to 'src/util.h')
-rw-r--r-- | src/util.h | 5 |
1 files changed, 3 insertions, 2 deletions
@@ -88,9 +88,10 @@ typedef unsigned char uint8; // -- utility macros --------------------------------------------------------- -template <bool> struct CompileAssert {}; +template <bool b> struct CompileAssert; +template <> struct CompileAssert<true> {}; #define COMPILE_ASSERT(expr, msg) \ - typedef CompileAssert<(bool(expr))> msg[bool(expr) ? 1 : -1] + enum { assert_##msg = sizeof(CompileAssert<bool(expr)>) } // Returns the number of elements in an array. #define arraysize(arr) (sizeof(arr)/sizeof(*(arr))) |