Go to the documentation of this file.
9 #ifndef _STRUS_STATIC_ASSERT_HPP_INCLUDED
10 #define _STRUS_STATIC_ASSERT_HPP_INCLUDED
14 #define STRUS_GCC_VERSION (__GNUC__ * 10000 + __GNUC_MINOR__ * 100 + __GNUC_PATCHLEVEL__)
17 #undef STRUS_USE_STD_STATIC_ASSERT
18 #if __cplusplus >= 201103L
20 #define STRUS_USE_STD_STATIC_ASSERT
21 #elif defined __GNUC__
22 #if STRUS_GCC_VERSION >= 40900
23 #define STRUS_USE_STD_STATIC_ASSERT
24 #endif // STRUS_GCC_VERSION
28 #ifdef STRUS_USE_STD_STATIC_ASSERT
29 #include <type_traits>
30 #define STRUS_STATIC_ASSERT( cond ) static_assert( (cond), "static assertion failed")
31 #else //STRUS_USE_STD_STATIC_ASSERT
32 #include <boost/static_assert.hpp>
33 #define STRUS_STATIC_ASSERT( cond ) BOOST_STATIC_ASSERT((cond))
34 #endif //STRUS_USE_STD_STATIC_ASSERT