Skip to content
This repository was archived by the owner on Mar 21, 2024. It is now read-only.
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions thrust/detail/allocator/allocator_traits.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@
#include <thrust/detail/type_traits/has_member_function.h>
#include <thrust/detail/type_traits.h>

#include <memory>

THRUST_NAMESPACE_BEGIN
namespace detail
{
Expand Down Expand Up @@ -70,6 +72,25 @@ template<typename Alloc, typename U>
typedef thrust::detail::integral_constant<bool, value> type;
};

Comment thread
alliepiper marked this conversation as resolved.
// 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 <typename T> \
struct trait_name<std::allocator<T>> : 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<typename T, typename U>
struct has_rebind<std::allocator<T>, U> : false_type {};
#endif

template<typename T>
struct nested_pointer
{
Expand Down