diff --git a/thrust/detail/allocator/allocator_traits.h b/thrust/detail/allocator/allocator_traits.h index cc710ed4a2..fb3c06a388 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 {