File indexing completed on 2025-07-02 08:08:00
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011 #ifndef BOOST_CONTAINER_DETAIL_WORKAROUND_HPP
0012 #define BOOST_CONTAINER_DETAIL_WORKAROUND_HPP
0013
0014 #ifndef BOOST_CONFIG_HPP
0015 # include <boost/config.hpp>
0016 #endif
0017
0018 #if defined(BOOST_HAS_PRAGMA_ONCE)
0019 # pragma once
0020 #endif
0021
0022 #if !defined(BOOST_NO_CXX11_RVALUE_REFERENCES) && !defined(BOOST_NO_CXX11_VARIADIC_TEMPLATES)\
0023 && !defined(BOOST_INTERPROCESS_DISABLE_VARIADIC_TMPL)
0024 #define BOOST_CONTAINER_PERFECT_FORWARDING
0025 #endif
0026
0027 #if !defined(BOOST_NO_CXX11_VARIADIC_TEMPLATES) && defined(__GXX_EXPERIMENTAL_CXX0X__)\
0028 && (__GNUC__*10000 + __GNUC_MINOR__*100 + __GNUC_PATCHLEVEL__ < 40700)
0029 #define BOOST_CONTAINER_UNIMPLEMENTED_PACK_EXPANSION_TO_FIXED_LIST
0030 #endif
0031
0032 #if defined(BOOST_GCC_VERSION)
0033 # if (BOOST_GCC_VERSION < 40700) || !defined(BOOST_GCC_CXX11)
0034 # define BOOST_CONTAINER_NO_CXX11_DELEGATING_CONSTRUCTORS
0035 # endif
0036 #elif defined(BOOST_MSVC)
0037 # if _MSC_FULL_VER < 180020827
0038 # define BOOST_CONTAINER_NO_CXX11_DELEGATING_CONSTRUCTORS
0039 # endif
0040 #elif defined(BOOST_CLANG)
0041 # if !__has_feature(cxx_delegating_constructors)
0042 # define BOOST_CONTAINER_NO_CXX11_DELEGATING_CONSTRUCTORS
0043 # endif
0044 #endif
0045
0046 #if defined(BOOST_MSVC) && (_MSC_VER < 1400)
0047 #define BOOST_CONTAINER_TEMPLATED_CONVERSION_OPERATOR_BROKEN
0048 #endif
0049
0050 #if !defined(BOOST_NO_CXX11_HDR_TUPLE) || (defined(BOOST_MSVC) && (BOOST_MSVC == 1700 || BOOST_MSVC == 1600))
0051 #define BOOST_CONTAINER_PAIR_TEST_HAS_HEADER_TUPLE
0052 #endif
0053
0054
0055 #define BOOST_CONTAINER_IMPDEF(TYPE) TYPE
0056 #define BOOST_CONTAINER_SEEDOC(TYPE) TYPE
0057
0058
0059
0060
0061
0062
0063 #ifndef BOOST_CONTAINER_MEMZEROED_FLOATING_POINT_IS_NOT_ZERO
0064 #define BOOST_CONTAINER_MEMZEROED_FLOATING_POINT_IS_ZERO 1
0065 #endif
0066
0067 #ifndef BOOST_CONTAINER_MEMZEROED_POINTER_IS_NOT_NULL
0068 #define BOOST_CONTAINER_MEMZEROED_POINTER_IS_NULL
0069 #endif
0070
0071 #define BOOST_CONTAINER_DOC1ST(TYPE1, TYPE2) TYPE2
0072 #define BOOST_CONTAINER_I ,
0073 #define BOOST_CONTAINER_DOCIGN(T) T
0074 #define BOOST_CONTAINER_DOCONLY(T)
0075
0076
0077
0078
0079
0080
0081
0082 #if defined(BOOST_ALL_DYN_LINK) || defined(BOOST_CONTAINER_DYN_LINK)
0083
0084
0085 #ifdef BOOST_CONTAINER_SOURCE
0086 # define BOOST_CONTAINER_DECL BOOST_SYMBOL_EXPORT
0087 #else
0088 # define BOOST_CONTAINER_DECL BOOST_SYMBOL_IMPORT
0089
0090 #endif
0091 #else
0092 #define BOOST_CONTAINER_DECL
0093 #endif
0094
0095
0096
0097 #if defined(BOOST_CONTAINER_DISABLE_FORCEINLINE)
0098 #define BOOST_CONTAINER_FORCEINLINE inline
0099 #elif defined(BOOST_CONTAINER_FORCEINLINE_IS_BOOST_FORCELINE)
0100 #define BOOST_CONTAINER_FORCEINLINE BOOST_FORCEINLINE
0101 #elif defined(BOOST_MSVC) && (_MSC_VER <= 1900 || defined(_DEBUG))
0102
0103 #define BOOST_CONTAINER_FORCEINLINE inline
0104 #elif defined(BOOST_CLANG) || (defined(BOOST_GCC) && ((__GNUC__ <= 5) || defined(__MINGW32__)))
0105
0106
0107
0108
0109 #define BOOST_CONTAINER_FORCEINLINE inline
0110 #else
0111 #define BOOST_CONTAINER_FORCEINLINE BOOST_FORCEINLINE
0112 #endif
0113
0114
0115
0116 #if defined(BOOST_CONTAINER_DISABLE_NOINLINE)
0117 #define BOOST_CONTAINER_NOINLINE
0118 #else
0119 #define BOOST_CONTAINER_NOINLINE BOOST_NOINLINE
0120 #endif
0121
0122
0123 #if !defined(__has_feature)
0124 #define BOOST_CONTAINER_HAS_FEATURE(feature) 0
0125 #else
0126 #define BOOST_CONTAINER_HAS_FEATURE(feature) __has_feature(feature)
0127 #endif
0128
0129
0130 #if defined(__SANITIZE_ADDRESS__) || BOOST_CONTAINER_HAS_FEATURE(address_sanitizer)
0131 #define BOOST_CONTAINER_ASAN
0132 #endif
0133
0134
0135 #if (BOOST_CXX_VERSION < 201703L) || !defined(__cpp_deduction_guides)
0136 #define BOOST_CONTAINER_NO_CXX17_CTAD
0137 #endif
0138
0139 #if defined(BOOST_CONTAINER_DISABLE_ATTRIBUTE_NODISCARD)
0140 #define BOOST_CONTAINER_ATTRIBUTE_NODISCARD
0141 #else
0142 #if defined(BOOST_GCC) && ((BOOST_GCC < 100000) || (__cplusplus < 201703L))
0143
0144
0145 #define BOOST_CONTAINER_ATTRIBUTE_NODISCARD
0146 #else
0147 #define BOOST_CONTAINER_ATTRIBUTE_NODISCARD BOOST_ATTRIBUTE_NODISCARD
0148 #endif
0149 #endif
0150
0151
0152
0153
0154
0155
0156
0157
0158 namespace boost {
0159 namespace container {
0160
0161 template <typename T1>
0162 BOOST_FORCEINLINE BOOST_CXX14_CONSTEXPR void ignore(T1 const&)
0163 {}
0164
0165 }}
0166
0167 #if !(defined BOOST_NO_EXCEPTIONS)
0168 # define BOOST_CONTAINER_TRY { try
0169 # define BOOST_CONTAINER_CATCH(x) catch(x)
0170 # define BOOST_CONTAINER_RETHROW throw;
0171 # define BOOST_CONTAINER_CATCH_END }
0172 #else
0173 # if !defined(BOOST_MSVC) || BOOST_MSVC >= 1900
0174 # define BOOST_CONTAINER_TRY { if (true)
0175 # define BOOST_CONTAINER_CATCH(x) else if (false)
0176 # else
0177
0178 # define BOOST_CONTAINER_TRY { \
0179 __pragma(warning(push)) \
0180 __pragma(warning(disable: 4127)) \
0181 if (true) \
0182 __pragma(warning(pop))
0183 # define BOOST_CONTAINER_CATCH(x) else \
0184 __pragma(warning(push)) \
0185 __pragma(warning(disable: 4127)) \
0186 if (false) \
0187 __pragma(warning(pop))
0188 # endif
0189 # define BOOST_CONTAINER_RETHROW
0190 # define BOOST_CONTAINER_CATCH_END }
0191 #endif
0192
0193 #ifndef BOOST_NO_CXX11_STATIC_ASSERT
0194 # ifndef BOOST_NO_CXX11_VARIADIC_MACROS
0195 # define BOOST_CONTAINER_STATIC_ASSERT( ... ) static_assert(__VA_ARGS__, #__VA_ARGS__)
0196 # else
0197 # define BOOST_CONTAINER_STATIC_ASSERT( B ) static_assert(B, #B)
0198 # endif
0199 #else
0200 namespace boost {
0201 namespace container {
0202 namespace dtl {
0203
0204 template<bool B>
0205 struct STATIC_ASSERTION_FAILURE;
0206
0207 template<>
0208 struct STATIC_ASSERTION_FAILURE<true> {};
0209
0210 template<unsigned> struct static_assert_test {};
0211
0212 }
0213 }
0214 }
0215
0216 #define BOOST_CONTAINER_STATIC_ASSERT(B) \
0217 typedef ::boost::container::dtl::static_assert_test<\
0218 (unsigned)sizeof(::boost::container::dtl::STATIC_ASSERTION_FAILURE<bool(B)>)>\
0219 BOOST_JOIN(boost_container_static_assert_typedef_, __LINE__) BOOST_ATTRIBUTE_UNUSED
0220
0221 #endif
0222
0223 #ifndef BOOST_NO_CXX11_STATIC_ASSERT
0224 # ifndef BOOST_NO_CXX11_VARIADIC_MACROS
0225 # define BOOST_CONTAINER_STATIC_ASSERT_MSG( ... ) static_assert(__VA_ARGS__)
0226 # else
0227 # define BOOST_CONTAINER_STATIC_ASSERT_MSG( B, Msg ) static_assert( B, Msg )
0228 # endif
0229 #else
0230 # define BOOST_CONTAINER_STATIC_ASSERT_MSG( B, Msg ) BOOST_CONTAINER_STATIC_ASSERT( B )
0231 #endif
0232
0233 #if !defined(BOOST_NO_CXX17_INLINE_VARIABLES)
0234 # define BOOST_CONTAINER_CONSTANT_VAR BOOST_INLINE_CONSTEXPR
0235 #else
0236 # define BOOST_CONTAINER_CONSTANT_VAR static BOOST_CONSTEXPR_OR_CONST
0237 #endif
0238
0239 #if defined(__GNUC__) && ((__GNUC__ * 10000 + __GNUC_MINOR__ * 100 + __GNUC_PATCHLEVEL__) >= 40600)
0240 #define BOOST_CONTAINER_GCC_COMPATIBLE_HAS_DIAGNOSTIC_IGNORED
0241 #elif defined(__clang__)
0242 #define BOOST_CONTAINER_GCC_COMPATIBLE_HAS_DIAGNOSTIC_IGNORED
0243 #endif
0244
0245 #endif