Skip to content
This repository was archived by the owner on Mar 21, 2024. It is now read-only.

Commit 8f17c03

Browse files
committed
Fix std::allocator traits
1 parent ed84044 commit 8f17c03

File tree

1 file changed

+27
-0
lines changed

1 file changed

+27
-0
lines changed

thrust/detail/allocator/allocator_traits.h

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@
2626
#include <thrust/detail/type_traits/has_member_function.h>
2727
#include <thrust/detail/type_traits.h>
2828

29+
#include <memory>
30+
2931
THRUST_NAMESPACE_BEGIN
3032
namespace detail
3133
{
@@ -70,6 +72,31 @@ template<typename Alloc, typename U>
7072
typedef thrust::detail::integral_constant<bool, value> type;
7173
};
7274

75+
#if THRUST_CPP_DIALECT >= 2017
76+
#define SPECIALIZE_DEPRECATED(trait_name) \
77+
template <typename T> \
78+
struct trait_name<std::allocator<T>> \
79+
{ \
80+
static bool const value = false; \
81+
typedef thrust::detail::integral_constant<bool, value> type; \
82+
};
83+
84+
SPECIALIZE_DEPRECATED(has_is_always_equal)
85+
SPECIALIZE_DEPRECATED(has_pointer)
86+
SPECIALIZE_DEPRECATED(has_const_pointer)
87+
SPECIALIZE_DEPRECATED(has_reference)
88+
SPECIALIZE_DEPRECATED(has_const_reference)
89+
90+
#undef SPECIALIZE_DEPRECATED
91+
92+
template<typename T, typename U>
93+
struct has_rebind<std::allocator<T>, U>
94+
{
95+
static bool const value = false;
96+
typedef thrust::detail::integral_constant<bool, value> type;
97+
};
98+
#endif
99+
73100
template<typename T>
74101
struct nested_pointer
75102
{

0 commit comments

Comments
 (0)