Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-08-08 08:44:29

0001 #ifndef BOOST_CORE_DETAIL_STATIC_ASSERT_HPP_INCLUDED
0002 #define BOOST_CORE_DETAIL_STATIC_ASSERT_HPP_INCLUDED
0003 
0004 // Copyright 2025 Peter Dimov
0005 // Distributed under the Boost Software License, Version 1.0.
0006 // https://www.boost.org/LICENSE_1_0.txt
0007 
0008 #if defined(__cpp_static_assert) && __cpp_static_assert >= 200410L
0009 
0010 #define BOOST_CORE_STATIC_ASSERT(...) static_assert(__VA_ARGS__, #__VA_ARGS__)
0011 
0012 #else
0013 
0014 #include <boost/config.hpp>
0015 #include <cstddef>
0016 
0017 namespace boost
0018 {
0019 namespace core
0020 {
0021 
0022 template<bool> struct STATIC_ASSERTION_FAILURE;
0023 
0024 template<> struct STATIC_ASSERTION_FAILURE<true>
0025 {
0026 };
0027 
0028 template<std::size_t> struct static_assert_test
0029 {
0030 };
0031 
0032 } // namespace core
0033 } // namespace boost
0034 
0035 #define BOOST_CORE_STATIC_ASSERT(expr) \
0036     typedef ::boost::core::static_assert_test< \
0037         sizeof( ::boost::core::STATIC_ASSERTION_FAILURE<(expr)? true: false> ) \
0038     > BOOST_JOIN(boost_static_assert_typedef_,__LINE__) BOOST_ATTRIBUTE_UNUSED
0039 
0040 #endif
0041 
0042 #endif  // #ifndef BOOST_CORE_DETAIL_STATIC_ASSERT_HPP_INCLUDED