From eb7bc1ff53cc7179e20bab6fefbefc7fb2840660 Mon Sep 17 00:00:00 2001 From: Glen Fernandes Date: Tue, 7 Dec 2021 10:10:07 -0500 Subject: [PATCH] Support additional is_empty intrinsics --- include/boost/core/allocator_access.hpp | 27 +++++++++++++++---------- 1 file changed, 16 insertions(+), 11 deletions(-) diff --git a/include/boost/core/allocator_access.hpp b/include/boost/core/allocator_access.hpp index 19a1129..6a64c0b 100644 --- a/include/boost/core/allocator_access.hpp +++ b/include/boost/core/allocator_access.hpp @@ -20,15 +20,21 @@ Distributed under the Boost Software License, Version 1.0. #endif #if defined(BOOST_GCC_VERSION) && (BOOST_GCC_VERSION >= 40300) -#define BOOST_DETAIL_ALLOC_HAS_IS_EMPTY +#define BOOST_DETAIL_ALLOC_EMPTY(T) __is_empty(T) #elif defined(BOOST_INTEL) && defined(_MSC_VER) && (_MSC_VER >= 1500) -#define BOOST_DETAIL_ALLOC_HAS_IS_EMPTY +#define BOOST_DETAIL_ALLOC_EMPTY(T) __is_empty(T) #elif defined(BOOST_MSVC) && (BOOST_MSVC >= 1400) -#define BOOST_DETAIL_ALLOC_HAS_IS_EMPTY +#define BOOST_DETAIL_ALLOC_EMPTY(T) __is_empty(T) #elif defined(BOOST_CLANG) && !defined(__CUDACC__) #if __has_feature(is_empty) -#define BOOST_DETAIL_ALLOC_HAS_IS_EMPTY +#define BOOST_DETAIL_ALLOC_EMPTY(T) __is_empty(T) #endif +#elif defined(__SUNPRO_CC) && (__SUNPRO_CC >= 0x5130) +#define BOOST_DETAIL_ALLOC_EMPTY(T) __oracle_is_empty(T) +#elif defined(__ghs__) && (__GHS_VERSION_NUMBER >= 600) +#define BOOST_DETAIL_ALLOC_EMPTY(T) __is_empty(T) +#elif defined(BOOST_CODEGEARC) +#define BOOST_DETAIL_ALLOC_EMPTY(T) __is_empty(T) #endif #if defined(_LIBCPP_SUPPRESS_DEPRECATED_PUSH) @@ -329,10 +335,10 @@ template struct alloc_equal { typedef typename std::is_empty::type type; }; -#elif defined(BOOST_DETAIL_ALLOC_HAS_IS_EMPTY) +#elif defined(BOOST_DETAIL_ALLOC_EMPTY) template struct alloc_equal { - typedef alloc_bool<__is_empty(A)> type; + typedef alloc_bool type; }; #else template @@ -385,9 +391,9 @@ struct alloc_none { }; template class alloc_has_allocate { template - static auto check(int) -> decltype(std::declval().allocate( - std::declval::type>(), - std::declval decltype(std::declval().allocate(std::declval::type>(), std::declval::type>())); template @@ -658,8 +664,7 @@ public: template class alloc_has_soccc { template - static auto check(int) - -> decltype(std::declval decltype(std::declval().select_on_container_copy_construction()); template