.. _program_listing_file__tmp_ws_src_ecl_lite_ecl_errors_include_ecl_errors_compile_time_assert.hpp: Program Listing for File compile_time_assert.hpp ================================================ |exhale_lsh| :ref:`Return to documentation for file ` (``/tmp/ws/src/ecl_lite/ecl_errors/include/ecl/errors/compile_time_assert.hpp``) .. |exhale_lsh| unicode:: U+021B0 .. UPWARDS ARROW WITH TIP LEFTWARDS .. code-block:: cpp /***************************************************************************** ** Ifdefs *****************************************************************************/ #ifndef ECL_ERRORS_COMPILE_TIME_ASSERT_HPP_ #define ECL_ERRORS_COMPILE_TIME_ASSERT_HPP_ /***************************************************************************** ** Includes *****************************************************************************/ #include "macros.hpp" /***************************************************************************** ** Namespaces *****************************************************************************/ namespace ecl { /***************************************************************************** ** Classes *****************************************************************************/ template struct COMPILE_TIME_FAILURE; template <> struct COMPILE_TIME_FAILURE {}; template struct static_assert_test {}; } // namespace ecl #define ecl_compile_time_assert( logical_expression ) \ typedef ecl::static_assert_test(logical_expression) >)> JOIN(compile_time_check,__LINE__) [[gnu::unused]] // If the (void)ERROR_##message is absent, we get unused variable warnings. #define ecl_verbose_compile_time_assert( logical_expression, message ) \ { \ ecl::COMPILE_TIME_FAILURE<( (logical_expression) != 0)> ERROR_##message; \ (void)ERROR_##message; \ } #endif /* ECL_ERRORS_COMPILE_TIME_ASSERT_HPP_ */