Commit 0e40dd95 authored by Stefan Gränitz's avatar Stefan Gränitz
Browse files

[libc++] Add std::add_pointer definition from cppreference.com

parent 7c6e4f22
......@@ -271,6 +271,18 @@ namespace std {
template <size_t Len, class... Types> struct aligned_union;
template <class T> struct decay;
namespace detail {
template <class T>
struct type_identity { typedef T type; };
template <class T>
auto try_add_pointer(int) -> type_identity<typename std::remove_reference<T>::type*>;
template <class T>
auto try_add_pointer(...) -> type_identity<T>;
} // namespace detail
template <class T>
struct add_pointer : decltype(detail::try_add_pointer<T>(0)) {};
template <bool, class T=void> struct enable_if;
template <class T> struct enable_if<true, T> { typedef T type; };
template <class T> struct enable_if<false, T> { };
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment