From a9d907f3726c021b690a1e08ed78ef3a9bfce8a8 Mon Sep 17 00:00:00 2001 From: Georgy Evtushenko Date: Mon, 30 Aug 2021 17:51:40 +0300 Subject: [PATCH] Fix std::allocator traits --- thrust/detail/allocator/allocator_traits.h | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/thrust/detail/allocator/allocator_traits.h b/thrust/detail/allocator/allocator_traits.h index cc710ed4a..fb3c06a38 100644 --- a/thrust/detail/allocator/allocator_traits.h +++ b/thrust/detail/allocator/allocator_traits.h @@ -26,6 +26,8 @@ #include #include +#include + THRUST_NAMESPACE_BEGIN namespace detail { @@ -70,6 +72,25 @@ template typedef thrust::detail::integral_constant type; }; +// The following fields of std::allocator have been deprecated (since C++17). +// There's no way to detect it other than explicit specialization. +#if THRUST_CPP_DIALECT >= 2017 +#define THRUST_SPECIALIZE_DEPRECATED(trait_name) \ +template \ +struct trait_name> : false_type {}; + +THRUST_SPECIALIZE_DEPRECATED(has_is_always_equal) +THRUST_SPECIALIZE_DEPRECATED(has_pointer) +THRUST_SPECIALIZE_DEPRECATED(has_const_pointer) +THRUST_SPECIALIZE_DEPRECATED(has_reference) +THRUST_SPECIALIZE_DEPRECATED(has_const_reference) + +#undef THRUST_SPECIALIZE_DEPRECATED + +template +struct has_rebind, U> : false_type {}; +#endif + template struct nested_pointer {