diff --git a/libcxx/include/__functional/bind.h b/libcxx/include/__functional/bind.h --- a/libcxx/include/__functional/bind.h +++ b/libcxx/include/__functional/bind.h @@ -25,9 +25,9 @@ template struct is_bind_expression : _If< - _IsSame<_Tp, typename __uncvref<_Tp>::type>::value, + _IsSame<_Tp, __uncvref_t<_Tp>>::value, false_type, - is_bind_expression::type> + is_bind_expression<__uncvref_t<_Tp>> > {}; #if _LIBCPP_STD_VER > 14 @@ -37,9 +37,9 @@ template struct is_placeholder : _If< - _IsSame<_Tp, typename __uncvref<_Tp>::type>::value, + _IsSame<_Tp, __uncvref_t<_Tp>>::value, integral_constant, - is_placeholder::type> + is_placeholder<__uncvref_t<_Tp>> > {}; #if _LIBCPP_STD_VER > 14 diff --git a/libcxx/include/__hash_table b/libcxx/include/__hash_table --- a/libcxx/include/__hash_table +++ b/libcxx/include/__hash_table @@ -47,7 +47,7 @@ struct __is_hash_value_type : false_type {}; template -struct __is_hash_value_type<_One> : __is_hash_value_type_imp::type> {}; +struct __is_hash_value_type<_One> : __is_hash_value_type_imp<__uncvref_t<_One>> {}; _LIBCPP_FUNC_VIS size_t __next_prime(size_t __n); diff --git a/libcxx/include/__memory/allocator_arg_t.h b/libcxx/include/__memory/allocator_arg_t.h --- a/libcxx/include/__memory/allocator_arg_t.h +++ b/libcxx/include/__memory/allocator_arg_t.h @@ -36,7 +36,7 @@ template struct __uses_alloc_ctor_imp { - typedef _LIBCPP_NODEBUG typename __uncvref<_Alloc>::type _RawAlloc; + typedef _LIBCPP_NODEBUG __uncvref_t<_Alloc> _RawAlloc; static const bool __ua = uses_allocator<_Tp, _RawAlloc>::value; static const bool __ic = is_constructible<_Tp, allocator_arg_t, _Alloc, _Args...>::value; diff --git a/libcxx/include/__tree b/libcxx/include/__tree --- a/libcxx/include/__tree +++ b/libcxx/include/__tree @@ -545,7 +545,7 @@ struct __is_tree_value_type : false_type {}; template -struct __is_tree_value_type<_One> : __is_tree_value_type_imp::type> {}; +struct __is_tree_value_type<_One> : __is_tree_value_type_imp<__uncvref_t<_One>> {}; template struct __tree_key_value_types { diff --git a/libcxx/include/__tuple b/libcxx/include/__tuple --- a/libcxx/include/__tuple +++ b/libcxx/include/__tuple @@ -469,8 +469,7 @@ struct __tuple_like_with_size_imp : integral_constant {}; -template ::type> +template > using __tuple_like_with_size _LIBCPP_NODEBUG = __tuple_like_with_size_imp< __tuple_like<_RawTuple>::value, tuple_size<_RawTuple>, _ExpectedSize diff --git a/libcxx/include/experimental/functional b/libcxx/include/experimental/functional --- a/libcxx/include/experimental/functional +++ b/libcxx/include/experimental/functional @@ -208,10 +208,8 @@ pair<_RandomAccessIterator2, _RandomAccessIterator2> operator ()(_RandomAccessIterator2 __f, _RandomAccessIterator2 __l) const { - static_assert ( std::is_same< - typename std::__uncvref::value_type>::type, - typename std::__uncvref::value_type>::type - >::value, + static_assert ( __is_same_uncvref::value_type, + typename iterator_traits<_RandomAccessIterator2>::value_type>::value, "Corpus and Pattern iterators must point to the same type" ); if (__f == __l ) return make_pair(__l, __l); // empty corpus @@ -360,11 +358,9 @@ pair<_RandomAccessIterator2, _RandomAccessIterator2> operator ()(_RandomAccessIterator2 __f, _RandomAccessIterator2 __l) const { - static_assert ( std::is_same< - typename std::__uncvref::value_type>::type, - typename std::__uncvref::value_type>::type - >::value, - "Corpus and Pattern iterators must point to the same type" ); + static_assert(__is_same_uncvref::value_type, + typename std::iterator_traits<_RandomAccessIterator2>::value_type>::value, + "Corpus and Pattern iterators must point to the same type" ); if (__f == __l ) return make_pair(__l, __l); // empty corpus if (__first_ == __last_) return make_pair(__f, __f); // empty pattern diff --git a/libcxx/include/future b/libcxx/include/future --- a/libcxx/include/future +++ b/libcxx/include/future @@ -1885,25 +1885,11 @@ _LIBCPP_INLINE_VISIBILITY packaged_task() _NOEXCEPT : __p_(nullptr) {} template ::type, - packaged_task - >::value - >::type - > + class = __enable_if_t, packaged_task>::value>> _LIBCPP_INLINE_VISIBILITY explicit packaged_task(_Fp&& __f) : __f_(_VSTD::forward<_Fp>(__f)) {} template ::type, - packaged_task - >::value - >::type - > + class = __enable_if_t, packaged_task>::value>> _LIBCPP_INLINE_VISIBILITY packaged_task(allocator_arg_t, const _Allocator& __a, _Fp&& __f) : __f_(allocator_arg, __a, _VSTD::forward<_Fp>(__f)), @@ -2014,25 +2000,11 @@ _LIBCPP_INLINE_VISIBILITY packaged_task() _NOEXCEPT : __p_(nullptr) {} template ::type, - packaged_task - >::value - >::type - > + class = __enable_if_t, packaged_task>::value>> _LIBCPP_INLINE_VISIBILITY explicit packaged_task(_Fp&& __f) : __f_(_VSTD::forward<_Fp>(__f)) {} template ::type, - packaged_task - >::value - >::type - > + class = __enable_if_t, packaged_task>::value>> _LIBCPP_INLINE_VISIBILITY packaged_task(allocator_arg_t, const _Allocator& __a, _Fp&& __f) : __f_(allocator_arg, __a, _VSTD::forward<_Fp>(__f)), diff --git a/libcxx/include/thread b/libcxx/include/thread --- a/libcxx/include/thread +++ b/libcxx/include/thread @@ -228,11 +228,7 @@ thread() _NOEXCEPT : __t_(_LIBCPP_NULL_THREAD) {} #ifndef _LIBCPP_CXX03_LANG template ::type, thread>::value - >::type - > + class = __enable_if_t, thread>::value>> _LIBCPP_METHOD_TEMPLATE_IMPLICIT_INSTANTIATION_VIS explicit thread(_Fp&& __f, _Args&&... __args); #else // _LIBCPP_CXX03_LANG diff --git a/libcxx/include/tuple b/libcxx/include/tuple --- a/libcxx/include/tuple +++ b/libcxx/include/tuple @@ -1456,8 +1456,7 @@ struct __tuple_cat_return_1, true, _Tuple0> { typedef _LIBCPP_NODEBUG typename __tuple_cat_type, - typename __make_tuple_types::type>::type>::type - type; + typename __make_tuple_types<__uncvref_t<_Tuple0>>::type>::type type; }; template @@ -1465,7 +1464,7 @@ : public __tuple_cat_return_1< typename __tuple_cat_type< tuple<_Types...>, - typename __make_tuple_types::type>::type + typename __make_tuple_types<__uncvref_t<_Tuple0>>::type >::type, __tuple_like::type>::value, _Tuple1, _Tuples...> diff --git a/libcxx/include/type_traits b/libcxx/include/type_traits --- a/libcxx/include/type_traits +++ b/libcxx/include/type_traits @@ -1274,13 +1274,6 @@ decltype(__declval<_Tp>(0)) declval() _NOEXCEPT; -// __uncvref - -template -struct __uncvref { - typedef _LIBCPP_NODEBUG typename remove_cv::type>::type type; -}; - template struct __unconstref { typedef _LIBCPP_NODEBUG typename remove_const::type>::type type; @@ -1288,19 +1281,20 @@ #ifndef _LIBCPP_CXX03_LANG template -using __uncvref_t _LIBCPP_NODEBUG = typename __uncvref<_Tp>::type; +using __uncvref_t _LIBCPP_NODEBUG = typename remove_cv::type>::type; #endif // __is_same_uncvref template -struct __is_same_uncvref : _IsSame::type, - typename __uncvref<_Up>::type> {}; +struct __is_same_uncvref : _IsSame<__uncvref_t<_Tp>, __uncvref_t<_Up>> {}; #if _LIBCPP_STD_VER > 17 // remove_cvref - same as __uncvref template -struct remove_cvref : public __uncvref<_Tp> {}; +struct remove_cvref { + using type = __uncvref_t<_Tp>; +}; template using remove_cvref_t = typename remove_cvref<_Tp>::type; #endif