Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-04-01 08:07:21

0001 //////////////////////////////////////////////////////////////////////////////
0002 //
0003 // (C) Copyright Ion Gaztanaga 2014-2014. Distributed under the Boost
0004 // Software License, Version 1.0. (See accompanying file
0005 // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
0006 //
0007 // See http://www.boost.org/libs/interprocess for documentation.
0008 //
0009 //////////////////////////////////////////////////////////////////////////////
0010 
0011 #ifndef BOOST_MOVE_DETAIL_WORKAROUND_HPP
0012 #define BOOST_MOVE_DETAIL_WORKAROUND_HPP
0013 
0014 #ifndef BOOST_CONFIG_HPP
0015 #  include <boost/config.hpp>
0016 #endif
0017 0018 ">#
0019 #if defined(BOOST_HAS_PRAGMA_ONCE)
0020 #  pragma once
0021 #endif
0022 
0023 #if    !defined(BOOST_NO_CXX11_RVALUE_REFERENCES) && !defined(BOOST_NO_CXX11_VARIADIC_TEMPLATES)
0024    #define BOOST_MOVE_PERFECT_FORWARDING
0025 #endif
0026 
0027 #if defined(__has_feature)
0028    #define BOOST_MOVE_HAS_FEATURE __has_feature
0029 #else
0030    #define BOOST_MOVE_HAS_FEATURE(x) 0
0031 #endif
0032 
0033 #if BOOST_MOVE_HAS_FEATURE(address_sanitizer) || defined(__SANITIZE_ADDRESS__)
0034    #define BOOST_MOVE_ADDRESS_SANITIZER_ON
0035 #endif
0036 
0037 //Macros for documentation purposes. For code, expands to the argument
0038 #define BOOST_MOVE_IMPDEF(TYPE) TYPE
0039 #define BOOST_MOVE_SEEDOC(TYPE) TYPE
0040 #define BOOST_MOVE_DOC0PTR(TYPE) TYPE
0041 #define BOOST_MOVE_DOC1ST(TYPE1, TYPE2) TYPE2
0042 #define BOOST_MOVE_I ,
0043 #define BOOST_MOVE_DOCIGN(T1) T1
0044 
0045 #if defined(__GNUC__) && (__GNUC__ == 4) && (__GNUC_MINOR__ < 5) && !defined(__clang__)
0046    //Pre-standard rvalue binding rules
0047    #define BOOST_MOVE_OLD_RVALUE_REF_BINDING_RULES
0048 #elif defined(_MSC_VER) && (_MSC_VER == 1600)
0049    //Standard rvalue binding rules but with some bugs
0050    #define BOOST_MOVE_MSVC_10_MEMBER_RVALUE_REF_BUG
0051    #define BOOST_MOVE_MSVC_AUTO_MOVE_RETURN_BUG
0052 #elif defined(_MSC_VER) && (_MSC_VER == 1700)
0053    #define BOOST_MOVE_MSVC_AUTO_MOVE_RETURN_BUG
0054 #endif
0055 
0056 //#define BOOST_MOVE_DISABLE_FORCEINLINE
0057 
0058 #if defined(BOOST_MOVE_DISABLE_FORCEINLINE)
0059    #define BOOST_MOVE_FORCEINLINE inline
0060 #elif defined(BOOST_MOVE_FORCEINLINE_IS_BOOST_FORCELINE)
0061    #define BOOST_MOVE_FORCEINLINE BOOST_FORCEINLINE
0062 #elif defined(BOOST_MSVC) && (_MSC_VER < 1900 || defined(_DEBUG))
0063    //"__forceinline" and MSVC seems to have some bugs in old versions and in debug mode
0064    #define BOOST_MOVE_FORCEINLINE inline
0065 #elif defined(BOOST_CLANG) || (defined(BOOST_GCC) && ((__GNUC__ <= 5) || defined(__MINGW32__)))
0066    //Older GCCs have problems with forceinline
0067    //Clang can have code bloat issues with forceinline, see
0068    //https://lists.boost.org/boost-users/2023/04/91445.php and
0069    //https://github.com/llvm/llvm-project/issues/62202
0070    #define BOOST_MOVE_FORCEINLINE inline
0071 #else
0072    #define BOOST_MOVE_FORCEINLINE BOOST_FORCEINLINE
0073 #endif
0074 
0075 namespace boost {
0076 namespace movelib {
0077 
0078 template <typename T1>
0079 BOOST_FORCEINLINE BOOST_CXX14_CONSTEXPR void ignore(T1 const&)
0080 {}
0081 
0082 }} //namespace boost::movelib {
0083 
0084 #if !(defined BOOST_NO_EXCEPTIONS)
0085 #    define BOOST_MOVE_TRY { try
0086 #    define BOOST_MOVE_CATCH(x) catch(x)
0087 #    define BOOST_MOVE_RETHROW throw;
0088 #    define BOOST_MOVE_CATCH_END }
0089 #else
0090 #    if !defined(BOOST_MSVC) || BOOST_MSVC >= 1900
0091 #        define BOOST_MOVE_TRY { if (true)
0092 #        define BOOST_MOVE_CATCH(x) else if (false)
0093 #    else
0094 // warning C4127: conditional expression is constant
0095 #        define BOOST_MOVE_TRY { \
0096              __pragma(warning(push)) \
0097              __pragma(warning(disable: 4127)) \
0098              if (true) \
0099              __pragma(warning(pop))
0100 #        define BOOST_MOVE_CATCH(x) else \
0101              __pragma(warning(push)) \
0102              __pragma(warning(disable: 4127)) \
0103              if (false) \
0104              __pragma(warning(pop))
0105 #    endif
0106 #    define BOOST_MOVE_RETHROW
0107 #    define BOOST_MOVE_CATCH_END }
0108 #endif
0109 
0110 #ifndef BOOST_NO_CXX11_STATIC_ASSERT
0111 #  ifndef BOOST_NO_CXX11_VARIADIC_MACROS
0112 #     define BOOST_MOVE_STATIC_ASSERT( ... ) static_assert(__VA_ARGS__, #__VA_ARGS__)
0113 #  else
0114 #     define BOOST_MOVE_STATIC_ASSERT( B ) static_assert(B, #B)
0115 #  endif
0116 #else
0117 namespace boost {
0118 namespace move_detail {
0119 
0120 template<bool B>
0121 struct STATIC_ASSERTION_FAILURE;
0122 
0123 template<>
0124 struct STATIC_ASSERTION_FAILURE<true>{};
0125 
0126 template<unsigned> struct static_assert_test {};
0127 
0128 }}
0129 
0130 #define BOOST_MOVE_STATIC_ASSERT(B) \
0131          typedef ::boost::move_detail::static_assert_test<\
0132             (unsigned)sizeof(::boost::move_detail::STATIC_ASSERTION_FAILURE<bool(B)>)>\
0133                BOOST_JOIN(boost_move_static_assert_typedef_, __LINE__) BOOST_ATTRIBUTE_UNUSED
0134 
0135 #endif
0136 
0137 #if !defined(__has_cpp_attribute) || defined(__CUDACC__)
0138 #define BOOST_MOVE_HAS_MSVC_ATTRIBUTE(ATTR) 0
0139 #else
0140 #define BOOST_MOVE_HAS_MSVC_ATTRIBUTE(ATTR) __has_cpp_attribute(msvc::ATTR)
0141 #endif
0142 
0143 // See https://devblogs.microsoft.com/cppblog/improving-the-state-of-debug-performance-in-c/
0144 // for details on how MSVC has improved debug experience, specifically for move/forward-like utilities
0145 #if BOOST_MOVE_HAS_MSVC_ATTRIBUTE(intrinsic)
0146 #define BOOST_MOVE_INTRINSIC_CAST [[msvc::intrinsic]]
0147 #else
0148 #define BOOST_MOVE_INTRINSIC_CAST BOOST_MOVE_FORCEINLINE
0149 #endif
0150 
0151 #if defined(__has_builtin)
0152 #if __has_builtin(__builtin_launder)
0153    #define BOOST_MOVE_HAS_BUILTIN_LAUNDER
0154 #endif
0155 #endif
0156 
0157 #endif   //#ifndef BOOST_MOVE_DETAIL_WORKAROUND_HPP