diff --git a/libcxx/include/CMakeLists.txt b/libcxx/include/CMakeLists.txt --- a/libcxx/include/CMakeLists.txt +++ b/libcxx/include/CMakeLists.txt @@ -13,7 +13,6 @@ __locale __memory/allocator_traits.h __memory/base.h - __memory/pointer_traits.h __memory/utilities.h __mutex_base __node_handle diff --git a/libcxx/include/__memory/allocator_traits.h b/libcxx/include/__memory/allocator_traits.h --- a/libcxx/include/__memory/allocator_traits.h +++ b/libcxx/include/__memory/allocator_traits.h @@ -12,7 +12,6 @@ #include <__config> #include <__memory/base.h> -#include <__memory/pointer_traits.h> #include #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) diff --git a/libcxx/include/__memory/base.h b/libcxx/include/__memory/base.h --- a/libcxx/include/__memory/base.h +++ b/libcxx/include/__memory/base.h @@ -120,6 +120,212 @@ #endif +// pointer_traits + +template +struct __has_element_type : false_type {}; + +template +struct __has_element_type<_Tp, + typename __void_t::type> : true_type {}; + +template ::value> +struct __pointer_traits_element_type; + +template +struct __pointer_traits_element_type<_Ptr, true> +{ + typedef _LIBCPP_NODEBUG_TYPE typename _Ptr::element_type type; +}; + +template