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

Commit

Permalink
Merge pull request #1518 from senior-zero/main-bug/github/msvc_std_al…
Browse files Browse the repository at this point in the history
…locator

Fix std::allocator traits
  • Loading branch information
gevtushenko authored Sep 23, 2021
2 parents cf21d24 + a9d907f commit 9af3392
Showing 1 changed file with 21 additions and 0 deletions.
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;
};

// 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

0 comments on commit 9af3392

Please sign in to comment.