diff --git a/libcxx/include/__memory/pointer_traits.h b/libcxx/include/__memory/pointer_traits.h index 4ba50898fb37d..0aaae3f9efc86 100644 --- a/libcxx/include/__memory/pointer_traits.h +++ b/libcxx/include/__memory/pointer_traits.h @@ -16,11 +16,13 @@ #include <__type_traits/conditional.h> #include <__type_traits/conjunction.h> #include <__type_traits/decay.h> +#include <__type_traits/detected_or.h> #include <__type_traits/enable_if.h> #include <__type_traits/integral_constant.h> #include <__type_traits/is_class.h> #include <__type_traits/is_function.h> #include <__type_traits/is_void.h> +#include <__type_traits/nat.h> #include <__type_traits/void_t.h> #include <__utility/declval.h> #include <__utility/forward.h> @@ -34,67 +36,37 @@ _LIBCPP_PUSH_MACROS _LIBCPP_BEGIN_NAMESPACE_STD -// clang-format off -#define _LIBCPP_CLASS_TRAITS_HAS_XXX(NAME, PROPERTY) \ - template \ - struct NAME : false_type {}; \ - template \ - struct NAME<_Tp, __void_t > : true_type {} -// clang-format on - -_LIBCPP_CLASS_TRAITS_HAS_XXX(__has_pointer, pointer); -_LIBCPP_CLASS_TRAITS_HAS_XXX(__has_element_type, element_type); - -template ::value> -struct __pointer_traits_element_type {}; - template -struct __pointer_traits_element_type<_Ptr, true> { - using type _LIBCPP_NODEBUG = typename _Ptr::element_type; -}; +struct __pointer_traits_element_type_impl {}; template