diff --git a/libcxx/include/__algorithm/copy.h b/libcxx/include/__algorithm/copy.h --- a/libcxx/include/__algorithm/copy.h +++ b/libcxx/include/__algorithm/copy.h @@ -40,7 +40,7 @@ template ::type, _OutValueT>::value + class = __enable_if_t, _OutValueT>::value && is_trivially_copy_assignable<_OutValueT>::value> > inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 pair<_InValueT*, _OutValueT*> __copy_impl(_InValueT* __first, _InValueT* __last, _OutValueT* __result) { @@ -58,7 +58,7 @@ } template >::type, __iter_value_type<_OutIter> >::value + __enable_if_t >, __iter_value_type<_OutIter> >::value && __is_cpp17_contiguous_iterator::value && __is_cpp17_contiguous_iterator::value && is_trivially_copy_assignable<__iter_value_type<_OutIter> >::value diff --git a/libcxx/include/__algorithm/half_positive.h b/libcxx/include/__algorithm/half_positive.h --- a/libcxx/include/__algorithm/half_positive.h +++ b/libcxx/include/__algorithm/half_positive.h @@ -29,7 +29,7 @@ >::type __half_positive(_Integral __value) { - return static_cast<_Integral>(static_cast::type>(__value) / 2); + return static_cast<_Integral>(static_cast<__make_unsigned_t<_Integral> >(__value) / 2); } template diff --git a/libcxx/include/__algorithm/iterator_operations.h b/libcxx/include/__algorithm/iterator_operations.h --- a/libcxx/include/__algorithm/iterator_operations.h +++ b/libcxx/include/__algorithm/iterator_operations.h @@ -97,7 +97,7 @@ template _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 static void __validate_iter_reference() { - static_assert(is_same<__deref_t<_Iter>, typename iterator_traits<__uncvref_t<_Iter> >::reference>::value, + static_assert(is_same<__deref_t<_Iter>, typename iterator_traits<__remove_cvref_t<_Iter> >::reference>::value, "It looks like your iterator's `iterator_traits::reference` does not match the return type of " "dereferencing the iterator, i.e., calling `*it`. This is undefined behavior according to [input.iterators] " "and can lead to dangling reference issues at runtime, so we are flagging this."); @@ -147,16 +147,16 @@ template _LIBCPP_HIDE_FROM_ABI static _LIBCPP_CONSTEXPR_SINCE_CXX14 - __uncvref_t<_Iter> next(_Iter&& __it, - typename iterator_traits<__uncvref_t<_Iter> >::difference_type __n = 1) { + __remove_cvref_t<_Iter> next(_Iter&& __it, + typename iterator_traits<__remove_cvref_t<_Iter> >::difference_type __n = 1) { return std::next(std::forward<_Iter>(__it), __n); } // prev template _LIBCPP_HIDE_FROM_ABI static _LIBCPP_CONSTEXPR_SINCE_CXX14 - __uncvref_t<_Iter> prev(_Iter&& __iter, - typename iterator_traits<__uncvref_t<_Iter> >::difference_type __n = 1) { + __remove_cvref_t<_Iter> prev(_Iter&& __iter, + typename iterator_traits<__remove_cvref_t<_Iter> >::difference_type __n = 1) { return std::prev(std::forward<_Iter>(__iter), __n); } diff --git a/libcxx/include/__algorithm/move.h b/libcxx/include/__algorithm/move.h --- a/libcxx/include/__algorithm/move.h +++ b/libcxx/include/__algorithm/move.h @@ -41,7 +41,7 @@ template ::type, _OutType>::value + class = __enable_if_t, _OutType>::value && is_trivially_move_assignable<_OutType>::value> > inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 pair<_InType*, _OutType*> __move_impl(_InType* __first, _InType* __last, _OutType* __result) { @@ -70,7 +70,7 @@ template ::value_type>::type, + __enable_if_t::value_type>, typename iterator_traits<_OutIter>::value_type>::value && __is_cpp17_contiguous_iterator<_InIter>::value && __is_cpp17_contiguous_iterator<_OutIter>::value diff --git a/libcxx/include/__algorithm/move_backward.h b/libcxx/include/__algorithm/move_backward.h --- a/libcxx/include/__algorithm/move_backward.h +++ b/libcxx/include/__algorithm/move_backward.h @@ -44,7 +44,7 @@ inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX17 typename enable_if < - is_same::type, _Up>::value && + is_same<__remove_const_t<_Tp>, _Up>::value && is_trivially_move_assignable<_Up>::value, _Up* >::type diff --git a/libcxx/include/__algorithm/partition.h b/libcxx/include/__algorithm/partition.h --- a/libcxx/include/__algorithm/partition.h +++ b/libcxx/include/__algorithm/partition.h @@ -79,7 +79,7 @@ inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 pair<_ForwardIterator, _ForwardIterator> __partition( _ForwardIterator __first, _Sentinel __last, _Predicate&& __pred, _IterCategory __iter_category) { - return std::__partition_impl<__uncvref_t<_Predicate>&, _AlgPolicy>( + return std::__partition_impl<__remove_cvref_t<_Predicate>&, _AlgPolicy>( std::move(__first), std::move(__last), __pred, __iter_category); } diff --git a/libcxx/include/__algorithm/ranges_iterator_concept.h b/libcxx/include/__algorithm/ranges_iterator_concept.h --- a/libcxx/include/__algorithm/ranges_iterator_concept.h +++ b/libcxx/include/__algorithm/ranges_iterator_concept.h @@ -26,7 +26,7 @@ template consteval auto __get_iterator_concept() { - using _Iter = __uncvref_t<_IterMaybeQualified>; + using _Iter = __remove_cvref_t<_IterMaybeQualified>; if constexpr (contiguous_iterator<_Iter>) return contiguous_iterator_tag(); diff --git a/libcxx/include/__algorithm/ranges_merge.h b/libcxx/include/__algorithm/ranges_merge.h --- a/libcxx/include/__algorithm/ranges_merge.h +++ b/libcxx/include/__algorithm/ranges_merge.h @@ -47,7 +47,7 @@ class _Comp, class _Proj1, class _Proj2> -_LIBCPP_HIDE_FROM_ABI constexpr merge_result<__uncvref_t<_InIter1>, __uncvref_t<_InIter2>, __uncvref_t<_OutIter>> +_LIBCPP_HIDE_FROM_ABI constexpr merge_result<__remove_cvref_t<_InIter1>, __remove_cvref_t<_InIter2>, __remove_cvref_t<_OutIter>> __merge_impl( _InIter1&& __first1, _Sent1&& __last1, diff --git a/libcxx/include/__algorithm/ranges_partition.h b/libcxx/include/__algorithm/ranges_partition.h --- a/libcxx/include/__algorithm/ranges_partition.h +++ b/libcxx/include/__algorithm/ranges_partition.h @@ -44,7 +44,7 @@ template _LIBCPP_HIDE_FROM_ABI static constexpr - subrange<__uncvref_t<_Iter>> __partition_fn_impl(_Iter&& __first, _Sent&& __last, _Pred&& __pred, _Proj&& __proj) { + subrange<__remove_cvref_t<_Iter>> __partition_fn_impl(_Iter&& __first, _Sent&& __last, _Pred&& __pred, _Proj&& __proj) { auto&& __projected_pred = std::__make_projected(__pred, __proj); auto __result = std::__partition<_RangeAlgPolicy>( std::move(__first), std::move(__last), __projected_pred, __iterator_concept<_Iter>()); diff --git a/libcxx/include/__algorithm/ranges_partition_copy.h b/libcxx/include/__algorithm/ranges_partition_copy.h --- a/libcxx/include/__algorithm/ranges_partition_copy.h +++ b/libcxx/include/__algorithm/ranges_partition_copy.h @@ -43,7 +43,7 @@ template _LIBCPP_HIDE_FROM_ABI constexpr static partition_copy_result< - __uncvref_t<_InIter>, __uncvref_t<_OutIter1>, __uncvref_t<_OutIter2> + __remove_cvref_t<_InIter>, __remove_cvref_t<_OutIter1>, __remove_cvref_t<_OutIter2> > __partition_copy_fn_impl( _InIter&& __first, _Sent&& __last, _OutIter1&& __out_true, _OutIter2&& __out_false, _Pred& __pred, _Proj& __proj) { for (; __first != __last; ++__first) { diff --git a/libcxx/include/__algorithm/ranges_stable_partition.h b/libcxx/include/__algorithm/ranges_stable_partition.h --- a/libcxx/include/__algorithm/ranges_stable_partition.h +++ b/libcxx/include/__algorithm/ranges_stable_partition.h @@ -45,7 +45,7 @@ template _LIBCPP_HIDE_FROM_ABI static - subrange<__uncvref_t<_Iter>> __stable_partition_fn_impl( + subrange<__remove_cvref_t<_Iter>> __stable_partition_fn_impl( _Iter&& __first, _Sent&& __last, _Pred&& __pred, _Proj&& __proj) { auto __last_iter = ranges::next(__first, __last); diff --git a/libcxx/include/__algorithm/set_difference.h b/libcxx/include/__algorithm/set_difference.h --- a/libcxx/include/__algorithm/set_difference.h +++ b/libcxx/include/__algorithm/set_difference.h @@ -27,7 +27,7 @@ _LIBCPP_BEGIN_NAMESPACE_STD template < class _Comp, class _InIter1, class _Sent1, class _InIter2, class _Sent2, class _OutIter> -_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 pair<__uncvref_t<_InIter1>, __uncvref_t<_OutIter> > +_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 pair<__remove_cvref_t<_InIter1>, __remove_cvref_t<_OutIter> > __set_difference( _InIter1&& __first1, _Sent1&& __last1, _InIter2&& __first2, _Sent2&& __last2, _OutIter&& __result, _Comp&& __comp) { while (__first1 != __last1 && __first2 != __last2) { diff --git a/libcxx/include/__algorithm/stable_partition.h b/libcxx/include/__algorithm/stable_partition.h --- a/libcxx/include/__algorithm/stable_partition.h +++ b/libcxx/include/__algorithm/stable_partition.h @@ -309,7 +309,7 @@ _LIBCPP_HIDE_FROM_ABI _ForwardIterator __stable_partition( _ForwardIterator __first, _ForwardIterator __last, _Predicate&& __pred, _IterCategory __iter_category) { - return std::__stable_partition_impl<_AlgPolicy, __uncvref_t<_Predicate>&>( + return std::__stable_partition_impl<_AlgPolicy, __remove_cvref_t<_Predicate>&>( std::move(__first), std::move(__last), __pred, __iter_category); } diff --git a/libcxx/include/__algorithm/uniform_random_bit_generator_adaptor.h b/libcxx/include/__algorithm/uniform_random_bit_generator_adaptor.h --- a/libcxx/include/__algorithm/uniform_random_bit_generator_adaptor.h +++ b/libcxx/include/__algorithm/uniform_random_bit_generator_adaptor.h @@ -42,9 +42,9 @@ using result_type = invoke_result_t<_Gen&>; _LIBCPP_HIDE_FROM_ABI - static constexpr auto min() { return __uncvref_t<_Gen>::min(); } + static constexpr auto min() { return __remove_cvref_t<_Gen>::min(); } _LIBCPP_HIDE_FROM_ABI - static constexpr auto max() { return __uncvref_t<_Gen>::max(); } + static constexpr auto max() { return __remove_cvref_t<_Gen>::max(); } _LIBCPP_HIDE_FROM_ABI constexpr explicit _ClassicGenAdaptor(_Gen& __g) : __gen_(__g) {} diff --git a/libcxx/include/__concepts/class_or_enum.h b/libcxx/include/__concepts/class_or_enum.h --- a/libcxx/include/__concepts/class_or_enum.h +++ b/libcxx/include/__concepts/class_or_enum.h @@ -28,7 +28,7 @@ // Work around Clang bug https://llvm.org/PR52970 // TODO: remove this workaround once libc++ no longer has to support Clang 13 (it was fixed in Clang 14). template -concept __workaround_52970 = is_class_v<__uncvref_t<_Tp>> || is_union_v<__uncvref_t<_Tp>>; +concept __workaround_52970 = is_class_v<__remove_cvref_t<_Tp>> || is_union_v<__remove_cvref_t<_Tp>>; #endif // _LIBCPP_STD_VER > 17 diff --git a/libcxx/include/__coroutine/coroutine_handle.h b/libcxx/include/__coroutine/coroutine_handle.h --- a/libcxx/include/__coroutine/coroutine_handle.h +++ b/libcxx/include/__coroutine/coroutine_handle.h @@ -115,7 +115,7 @@ _LIBCPP_HIDE_FROM_ABI static coroutine_handle from_promise(_Promise& __promise) { - using _RawPromise = typename remove_cv<_Promise>::type; + using _RawPromise = __remove_cv_t<_Promise>; coroutine_handle __tmp; __tmp.__handle_ = __builtin_coro_promise(_VSTD::addressof(const_cast<_RawPromise&>(__promise)), alignof(_Promise), true); diff --git a/libcxx/include/__filesystem/path.h b/libcxx/include/__filesystem/path.h --- a/libcxx/include/__filesystem/path.h +++ b/libcxx/include/__filesystem/path.h @@ -141,15 +141,15 @@ template ::type, class _UnqualPtrType = - typename remove_const::type>::type, + __remove_const_t<__remove_pointer_t<_DS> >, bool _IsCharPtr = is_pointer<_DS>::value&& __can_convert_char<_UnqualPtrType>::value> struct __is_pathable_char_array : false_type {}; template struct __is_pathable_char_array<_Source, _ECharT*, _UPtr, true> - : __can_convert_char::type> { - using _Base = __can_convert_char::type>; + : __can_convert_char<__remove_const_t<_ECharT> > { + using _Base = __can_convert_char<__remove_const_t<_ECharT> >; _LIBCPP_HIDE_FROM_ABI static _ECharT const* __range_begin(const _ECharT* __b) { return __b; } 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, __uncvref_t<_Tp> >::value, + _IsSame<_Tp, __remove_cvref_t<_Tp> >::value, false_type, - is_bind_expression<__uncvref_t<_Tp> > + is_bind_expression<__remove_cvref_t<_Tp> > > {}; #if _LIBCPP_STD_VER > 14 @@ -37,9 +37,9 @@ template struct is_placeholder : _If< - _IsSame<_Tp, __uncvref_t<_Tp> >::value, + _IsSame<_Tp, __remove_cvref_t<_Tp> >::value, integral_constant, - is_placeholder<__uncvref_t<_Tp> > + is_placeholder<__remove_cvref_t<_Tp> > > {}; #if _LIBCPP_STD_VER > 14 @@ -279,7 +279,7 @@ class = typename enable_if < is_constructible<_Fd, _Gp>::value && - !is_same::type, + !is_same<__libcpp_remove_reference_t<_Gp>, __bind>::value >::type> _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX20 @@ -324,7 +324,7 @@ class = typename enable_if < is_constructible<_Fd, _Gp>::value && - !is_same::type, + !is_same<__libcpp_remove_reference_t<_Gp>, __bind_r>::value >::type> _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX20 diff --git a/libcxx/include/__functional/function.h b/libcxx/include/__functional/function.h --- a/libcxx/include/__functional/function.h +++ b/libcxx/include/__functional/function.h @@ -974,7 +974,7 @@ __func __f_; template , function>, + _IsNotSame<__remove_cvref_t<_Fp>, function>, __invokable<_Fp, _ArgTypes...> >::value> struct __callable; diff --git a/libcxx/include/__functional/invoke.h b/libcxx/include/__functional/invoke.h --- a/libcxx/include/__functional/invoke.h +++ b/libcxx/include/__functional/invoke.h @@ -248,7 +248,7 @@ template struct __member_pointer_traits - : public __member_pointer_traits_imp::type, + : public __member_pointer_traits_imp<__remove_cv_t<_MP>, is_member_function_pointer<_MP>::value, is_member_object_pointer<_MP>::value> { diff --git a/libcxx/include/__hash_table b/libcxx/include/__hash_table --- a/libcxx/include/__hash_table +++ b/libcxx/include/__hash_table @@ -57,7 +57,7 @@ struct __is_hash_value_type : false_type {}; template -struct __is_hash_value_type<_One> : __is_hash_value_type_imp<__uncvref_t<_One> > {}; +struct __is_hash_value_type<_One> : __is_hash_value_type_imp<__remove_cvref_t<_One> > {}; _LIBCPP_FUNC_VIS size_t __next_prime(size_t __n); @@ -67,7 +67,7 @@ { typedef typename pointer_traits<_NodePtr>::element_type __node_type; typedef __hash_node_base __first_node; - typedef typename __rebind_pointer<_NodePtr, __first_node>::type __node_base_pointer; + typedef __rebind_pointer_t<_NodePtr, __first_node> __node_base_pointer; typedef _NodePtr __node_pointer; #if defined(_LIBCPP_ABI_FIX_UNORDERED_NODE_POINTER_UB) @@ -105,7 +105,7 @@ struct _LIBCPP_STANDALONE_DEBUG __hash_node : public __hash_node_base < - typename __rebind_pointer<_VoidPtr, __hash_node<_Tp, _VoidPtr> >::type + __rebind_pointer_t<_VoidPtr, __hash_node<_Tp, _VoidPtr> > > { typedef _Tp __node_value_type; @@ -217,9 +217,9 @@ template struct __hash_map_pointer_types<_Tp, _AllocPtr, _KVTypes, true> { typedef typename _KVTypes::__map_value_type _Mv; - typedef typename __rebind_pointer<_AllocPtr, _Mv>::type + typedef __rebind_pointer_t<_AllocPtr, _Mv> __map_value_type_pointer; - typedef typename __rebind_pointer<_AllocPtr, const _Mv>::type + typedef __rebind_pointer_t<_AllocPtr, const _Mv> __const_map_value_type_pointer; }; @@ -237,21 +237,21 @@ typedef ptrdiff_t difference_type; typedef size_t size_type; - typedef typename __rebind_pointer<_NodePtr, void>::type __void_pointer; + typedef __rebind_pointer_t<_NodePtr, void> __void_pointer; typedef typename pointer_traits<_NodePtr>::element_type __node_type; typedef _NodePtr __node_pointer; typedef __hash_node_base<__node_pointer> __node_base_type; - typedef typename __rebind_pointer<_NodePtr, __node_base_type>::type + typedef __rebind_pointer_t<_NodePtr, __node_base_type> __node_base_pointer; typedef typename __node_base_type::__next_pointer __next_pointer; typedef _Tp __node_value_type; - typedef typename __rebind_pointer<_VoidPtr, __node_value_type>::type + typedef __rebind_pointer_t<_VoidPtr, __node_value_type> __node_value_type_pointer; - typedef typename __rebind_pointer<_VoidPtr, const __node_value_type>::type + typedef __rebind_pointer_t<_VoidPtr, const __node_value_type> __const_node_value_type_pointer; private: @@ -259,7 +259,7 @@ "_NodePtr should never be a pointer to const"); static_assert((is_same::element_type, void>::value), "_VoidPtr does not point to unqualified void type"); - static_assert((is_same::type, + static_assert((is_same<__rebind_pointer_t<_VoidPtr, __node_type>, _NodePtr>::value), "_VoidPtr does not rebind to _NodePtr."); }; @@ -278,7 +278,7 @@ template struct __make_hash_node_types { typedef __hash_node<_NodeValueTp, _VoidPtr> _NodeTp; - typedef typename __rebind_pointer<_VoidPtr, _NodeTp>::type _NodePtr; + typedef __rebind_pointer_t<_VoidPtr, _NodeTp> _NodePtr; typedef __hash_node_types<_NodePtr> type; }; @@ -623,8 +623,8 @@ typedef pointer_traits<__node_pointer> __pointer_traits; typedef typename __pointer_traits::element_type __node; - typedef typename remove_const<__node>::type __non_const_node; - typedef typename __rebind_pointer<__node_pointer, __non_const_node>::type + typedef __remove_const_t<__node> __non_const_node; + typedef __rebind_pointer_t<__node_pointer, __non_const_node> __non_const_node_pointer; public: typedef __hash_local_iterator<__non_const_node_pointer> diff --git a/libcxx/include/__iterator/distance.h b/libcxx/include/__iterator/distance.h --- a/libcxx/include/__iterator/distance.h +++ b/libcxx/include/__iterator/distance.h @@ -75,7 +75,7 @@ template> _Sp> _LIBCPP_HIDE_FROM_ABI constexpr iter_difference_t<_Ip> operator()(_Ip&& __first, _Sp __last) const { - if constexpr (sized_sentinel_for<_Sp, __uncvref_t<_Ip>>) { + if constexpr (sized_sentinel_for<_Sp, __remove_cvref_t<_Ip>>) { return __last - __first; } else { return __last - decay_t<_Ip>(__first); diff --git a/libcxx/include/__iterator/iterator_traits.h b/libcxx/include/__iterator/iterator_traits.h --- a/libcxx/include/__iterator/iterator_traits.h +++ b/libcxx/include/__iterator/iterator_traits.h @@ -408,7 +408,7 @@ struct _LIBCPP_TEMPLATE_VIS iterator_traits<_Tp*> { typedef ptrdiff_t difference_type; - typedef typename remove_cv<_Tp>::type value_type; + typedef __remove_cv_t<_Tp> value_type; typedef _Tp* pointer; typedef _Tp& reference; typedef random_access_iterator_tag iterator_category; @@ -493,7 +493,7 @@ using __iter_value_type = typename iterator_traits<_InputIterator>::value_type; template -using __iter_key_type = typename remove_const::value_type::first_type>::type; +using __iter_key_type = __remove_const_t::value_type::first_type>; template using __iter_mapped_type = typename iterator_traits<_InputIterator>::value_type::second_type; diff --git a/libcxx/include/__iterator/move_iterator.h b/libcxx/include/__iterator/move_iterator.h --- a/libcxx/include/__iterator/move_iterator.h +++ b/libcxx/include/__iterator/move_iterator.h @@ -82,7 +82,7 @@ typedef typename iterator_traits::reference __reference; typedef typename conditional< is_reference<__reference>::value, - typename remove_reference<__reference>::type&&, + __libcpp_remove_reference_t<__reference>&&, __reference >::type reference; #endif // _LIBCPP_STD_VER > 17 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 __uncvref_t<_Alloc> _RawAlloc; + typedef _LIBCPP_NODEBUG __remove_cvref_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/__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 @@ -33,7 +33,7 @@ // __pointer _LIBCPP_ALLOCATOR_TRAITS_HAS_XXX(__has_pointer, pointer); template ::type, + class _RawAlloc = __libcpp_remove_reference_t<_Alloc>, bool = __has_pointer<_RawAlloc>::value> struct __pointer { using type _LIBCPP_NODEBUG = typename _RawAlloc::pointer; diff --git a/libcxx/include/__memory/pointer_traits.h b/libcxx/include/__memory/pointer_traits.h --- a/libcxx/include/__memory/pointer_traits.h +++ b/libcxx/include/__memory/pointer_traits.h @@ -151,14 +151,13 @@ {return _VSTD::addressof(__r);} }; -template -struct __rebind_pointer { #ifndef _LIBCPP_CXX03_LANG - typedef typename pointer_traits<_From>::template rebind<_To> type; +template +using __rebind_pointer_t = typename pointer_traits<_From>::template rebind<_To>; #else - typedef typename pointer_traits<_From>::template rebind<_To>::other type; +template +using __rebind_pointer_t = typename pointer_traits<_From>::template rebind<_To>::other; #endif -}; // to_address diff --git a/libcxx/include/__memory/shared_ptr.h b/libcxx/include/__memory/shared_ptr.h --- a/libcxx/include/__memory/shared_ptr.h +++ b/libcxx/include/__memory/shared_ptr.h @@ -690,7 +690,7 @@ { typedef typename __shared_ptr_default_allocator<_Yp>::type _AllocT; typedef __shared_ptr_pointer::pointer, - reference_wrapper::type>, + reference_wrapper<__libcpp_remove_reference_t<_Dp> >, _AllocT> _CntrlBlk; __cntrl_ = new _CntrlBlk(__r.get(), _VSTD::ref(__r.get_deleter()), _AllocT()); __enable_weak_this(__r.get(), __r.get()); @@ -805,7 +805,7 @@ } _LIBCPP_HIDE_FROM_ABI - typename add_lvalue_reference::type operator*() const _NOEXCEPT + __add_lvalue_reference_t operator*() const _NOEXCEPT { return *__ptr_; } @@ -858,7 +858,7 @@ #if _LIBCPP_STD_VER > 14 _LIBCPP_HIDE_FROM_ABI - typename add_lvalue_reference::type operator[](ptrdiff_t __i) const + __add_lvalue_reference_t operator[](ptrdiff_t __i) const { static_assert(is_array<_Tp>::value, "std::shared_ptr::operator[] is only valid when T is an array type."); @@ -907,7 +907,7 @@ _LIBCPP_HIDE_FROM_ABI void __enable_weak_this(const enable_shared_from_this<_Yp>* __e, _OrigPtr* __ptr) _NOEXCEPT { - typedef typename remove_cv<_Yp>::type _RawYp; + typedef __remove_cv_t<_Yp> _RawYp; if (__e && __e->__weak_this_.expired()) { __e->__weak_this_ = shared_ptr<_RawYp>(*this, diff --git a/libcxx/include/__memory/uninitialized_algorithms.h b/libcxx/include/__memory/uninitialized_algorithms.h --- a/libcxx/include/__memory/uninitialized_algorithms.h +++ b/libcxx/include/__memory/uninitialized_algorithms.h @@ -558,7 +558,7 @@ template ::type, + class _RawType = __remove_const_t<_Type>, __enable_if_t< // using _RawType because of the allocator extension is_trivially_copy_constructible<_RawType>::value && is_trivially_copy_assignable<_RawType>::value && diff --git a/libcxx/include/__memory/unique_ptr.h b/libcxx/include/__memory/unique_ptr.h --- a/libcxx/include/__memory/unique_ptr.h +++ b/libcxx/include/__memory/unique_ptr.h @@ -251,7 +251,7 @@ return *this; } - _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX23 typename add_lvalue_reference<_Tp>::type operator*() const { + _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX23 __add_lvalue_reference_t<_Tp> operator*() const { return *__ptr_.first(); } _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX23 pointer operator->() const _NOEXCEPT { @@ -448,7 +448,7 @@ return *this; } - _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX23 typename add_lvalue_reference<_Tp>::type + _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX23 __add_lvalue_reference_t<_Tp> operator[](size_t __i) const { return __ptr_.first()[__i]; } @@ -673,7 +673,7 @@ template inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX23 typename __unique_if<_Tp>::__unique_array_unknown_bound make_unique(size_t __n) { - typedef typename remove_extent<_Tp>::type _Up; + typedef __remove_extent_t<_Tp> _Up; return unique_ptr<_Tp>(new _Up[__n]()); } diff --git a/libcxx/include/__node_handle b/libcxx/include/__node_handle --- a/libcxx/include/__node_handle +++ b/libcxx/include/__node_handle @@ -91,8 +91,8 @@ _NodeType, __basic_node_handle<_NodeType, _Alloc, _MapOrSetSpecifics>>; typedef allocator_traits<_Alloc> __alloc_traits; - typedef typename __rebind_pointer::type + typedef __rebind_pointer_t __node_pointer_type; public: diff --git a/libcxx/include/__numeric/gcd_lcm.h b/libcxx/include/__numeric/gcd_lcm.h --- a/libcxx/include/__numeric/gcd_lcm.h +++ b/libcxx/include/__numeric/gcd_lcm.h @@ -60,8 +60,8 @@ gcd(_Tp __m, _Up __n) { static_assert((is_integral<_Tp>::value && is_integral<_Up>::value), "Arguments to gcd must be integer types"); - static_assert((!is_same::type, bool>::value), "First argument to gcd cannot be bool" ); - static_assert((!is_same::type, bool>::value), "Second argument to gcd cannot be bool" ); + static_assert((!is_same<__remove_cv_t<_Tp>, bool>::value), "First argument to gcd cannot be bool" ); + static_assert((!is_same<__remove_cv_t<_Up>, bool>::value), "Second argument to gcd cannot be bool" ); using _Rp = common_type_t<_Tp,_Up>; using _Wp = make_unsigned_t<_Rp>; return static_cast<_Rp>(_VSTD::__gcd( @@ -75,8 +75,8 @@ lcm(_Tp __m, _Up __n) { static_assert((is_integral<_Tp>::value && is_integral<_Up>::value), "Arguments to lcm must be integer types"); - static_assert((!is_same::type, bool>::value), "First argument to lcm cannot be bool" ); - static_assert((!is_same::type, bool>::value), "Second argument to lcm cannot be bool" ); + static_assert((!is_same<__remove_cv_t<_Tp>, bool>::value), "First argument to lcm cannot be bool" ); + static_assert((!is_same<__remove_cv_t<_Up>, bool>::value), "Second argument to lcm cannot be bool" ); if (__m == 0 || __n == 0) return 0; diff --git a/libcxx/include/__random/is_seed_sequence.h b/libcxx/include/__random/is_seed_sequence.h --- a/libcxx/include/__random/is_seed_sequence.h +++ b/libcxx/include/__random/is_seed_sequence.h @@ -23,7 +23,7 @@ { static _LIBCPP_CONSTEXPR const bool value = !is_convertible<_Sseq, typename _Engine::result_type>::value && - !is_same::type, _Engine>::value; + !is_same<__remove_cv_t<_Sseq>, _Engine>::value; }; _LIBCPP_END_NAMESPACE_STD diff --git a/libcxx/include/__random/uniform_int_distribution.h b/libcxx/include/__random/uniform_int_distribution.h --- a/libcxx/include/__random/uniform_int_distribution.h +++ b/libcxx/include/__random/uniform_int_distribution.h @@ -238,7 +238,7 @@ { static_assert(__libcpp_random_is_valid_urng<_URNG>::value, ""); typedef typename conditional::type>::type _UIntType; + __make_unsigned_t >::type _UIntType; const _UIntType _Rp = _UIntType(__p.b()) - _UIntType(__p.a()) + _UIntType(1); if (_Rp == 1) return __p.a(); diff --git a/libcxx/include/__split_buffer b/libcxx/include/__split_buffer --- a/libcxx/include/__split_buffer +++ b/libcxx/include/__split_buffer @@ -51,7 +51,7 @@ public: typedef _Tp value_type; typedef _Allocator allocator_type; - typedef typename remove_reference::type __alloc_rr; + typedef __libcpp_remove_reference_t __alloc_rr; typedef allocator_traits<__alloc_rr> __alloc_traits; typedef value_type& reference; typedef const value_type& const_reference; @@ -67,8 +67,8 @@ pointer __end_; __compressed_pair __end_cap_; - typedef typename add_lvalue_reference::type __alloc_ref; - typedef typename add_lvalue_reference::type __alloc_const_ref; + typedef __add_lvalue_reference_t __alloc_ref; + typedef __add_lvalue_reference_t __alloc_const_ref; _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI __alloc_rr& __alloc() _NOEXCEPT {return __end_cap_.second();} _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI const __alloc_rr& __alloc() const _NOEXCEPT {return __end_cap_.second();} diff --git a/libcxx/include/__tree b/libcxx/include/__tree --- a/libcxx/include/__tree +++ b/libcxx/include/__tree @@ -560,7 +560,7 @@ struct __is_tree_value_type : false_type {}; template -struct __is_tree_value_type<_One> : __is_tree_value_type_imp<__uncvref_t<_One> > {}; +struct __is_tree_value_type<_One> : __is_tree_value_type_imp<__remove_cvref_t<_One> > {}; template struct __tree_key_value_types { @@ -638,11 +638,11 @@ typedef _VoidPtr __void_pointer; typedef __tree_node_base<__void_pointer> __node_base_type; - typedef typename __rebind_pointer<_VoidPtr, __node_base_type>::type + typedef __rebind_pointer_t<_VoidPtr, __node_base_type> __node_base_pointer; typedef __tree_end_node<__node_base_pointer> __end_node_type; - typedef typename __rebind_pointer<_VoidPtr, __end_node_type>::type + typedef __rebind_pointer_t<_VoidPtr, __end_node_type> __end_node_pointer; #if defined(_LIBCPP_ABI_TREE_REMOVE_NODE_POINTER_UB) typedef __end_node_pointer __parent_pointer; @@ -665,9 +665,9 @@ template struct __tree_map_pointer_types<_Tp, _AllocPtr, _KVTypes, true> { typedef typename _KVTypes::__map_value_type _Mv; - typedef typename __rebind_pointer<_AllocPtr, _Mv>::type + typedef __rebind_pointer_t<_AllocPtr, _Mv> __map_value_type_pointer; - typedef typename __rebind_pointer<_AllocPtr, const _Mv>::type + typedef __rebind_pointer_t<_AllocPtr, const _Mv> __const_map_value_type_pointer; }; @@ -689,9 +689,9 @@ typedef _NodePtr __node_pointer; typedef _Tp __node_value_type; - typedef typename __rebind_pointer<_VoidPtr, __node_value_type>::type + typedef __rebind_pointer_t<_VoidPtr, __node_value_type> __node_value_type_pointer; - typedef typename __rebind_pointer<_VoidPtr, const __node_value_type>::type + typedef __rebind_pointer_t<_VoidPtr, const __node_value_type> __const_node_value_type_pointer; #if defined(_LIBCPP_ABI_TREE_REMOVE_NODE_POINTER_UB) typedef typename __base::__end_node_pointer __iter_pointer; @@ -704,13 +704,13 @@ private: static_assert(!is_const<__node_type>::value, "_NodePtr should never be a pointer to const"); - static_assert((is_same::type, + static_assert((is_same<__rebind_pointer_t<_VoidPtr, __node_type>, _NodePtr>::value), "_VoidPtr does not rebind to _NodePtr."); }; template struct __make_tree_node_types { - typedef typename __rebind_pointer<_VoidPtr, __tree_node<_ValueTp, _VoidPtr> >::type + typedef __rebind_pointer_t<_VoidPtr, __tree_node<_ValueTp, _VoidPtr> > _NodePtr; typedef __tree_node_types<_NodePtr> type; }; @@ -1277,14 +1277,14 @@ } template ::type, __container_value_type>::value> > + class = __enable_if_t, __container_value_type>::value> > _LIBCPP_INLINE_VISIBILITY pair __insert_unique(_Vp&& __v) { return __emplace_unique(_VSTD::forward<_Vp>(__v)); } template ::type, __container_value_type>::value> > + class = __enable_if_t, __container_value_type>::value> > _LIBCPP_INLINE_VISIBILITY iterator __insert_unique(const_iterator __p, _Vp&& __v) { return __emplace_hint_unique(__p, _VSTD::forward<_Vp>(__v)); diff --git a/libcxx/include/__tuple/apply_cv.h b/libcxx/include/__tuple/apply_cv.h --- a/libcxx/include/__tuple/apply_cv.h +++ b/libcxx/include/__tuple/apply_cv.h @@ -57,7 +57,7 @@ struct __apply_cv_mf { template using __apply _LIBCPP_NODEBUG = const volatile _Tp&; }; -template ::type> +template > using __apply_cv_t _LIBCPP_NODEBUG = __apply_cv_mf< is_lvalue_reference<_Tp>::value, is_const<_RawTp>::value, diff --git a/libcxx/include/__tuple/make_tuple_types.h b/libcxx/include/__tuple/make_tuple_types.h --- a/libcxx/include/__tuple/make_tuple_types.h +++ b/libcxx/include/__tuple/make_tuple_types.h @@ -56,13 +56,13 @@ >; }; -template ::type>::value, +template >::value, size_t _Sp = 0, - bool _SameSize = (_Ep == tuple_size::type>::value)> + bool _SameSize = (_Ep == tuple_size<__libcpp_remove_reference_t<_Tp> >::value)> struct __make_tuple_types { static_assert(_Sp <= _Ep, "__make_tuple_types input error"); - using _RawTp = typename remove_cv::type>::type; + using _RawTp = __remove_cv_t<__libcpp_remove_reference_t<_Tp> >; using _Maker = __make_tuple_types_flat<_RawTp, typename __make_tuple_indices<_Ep, _Sp>::type>; using type = typename _Maker::template __apply_quals<_Tp>; }; diff --git a/libcxx/include/__tuple/sfinae_helpers.h b/libcxx/include/__tuple/sfinae_helpers.h --- a/libcxx/include/__tuple/sfinae_helpers.h +++ b/libcxx/include/__tuple/sfinae_helpers.h @@ -58,7 +58,7 @@ // __tuple_convertible -template ::type>::value, +template >::value, bool = __tuple_like<_Up>::value> struct __tuple_convertible : public false_type {}; @@ -73,7 +73,7 @@ // __tuple_constructible -template ::type>::value, +template >::value, bool = __tuple_like<_Up>::value> struct __tuple_constructible : public false_type {}; @@ -88,7 +88,7 @@ // __tuple_assignable -template ::type>::value, +template >::value, bool = __tuple_like<_Up>::value> struct __tuple_assignable : public false_type {}; @@ -115,7 +115,7 @@ struct __tuple_like_with_size_imp : integral_constant {}; -template > +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/__type_traits/add_lvalue_reference.h b/libcxx/include/__type_traits/add_lvalue_reference.h --- a/libcxx/include/__type_traits/add_lvalue_reference.h +++ b/libcxx/include/__type_traits/add_lvalue_reference.h @@ -19,23 +19,33 @@ _LIBCPP_BEGIN_NAMESPACE_STD #if __has_builtin(__add_lvalue_reference) + template -struct add_lvalue_reference { - using type _LIBCPP_NODEBUG = __add_lvalue_reference(_Tp); -}; +using __add_lvalue_reference_t = __add_lvalue_reference(_Tp); + #else + template ::value> struct __add_lvalue_reference_impl { typedef _LIBCPP_NODEBUG _Tp type; }; -template struct __add_lvalue_reference_impl<_Tp, true> { typedef _LIBCPP_NODEBUG _Tp& type; }; +template +struct __add_lvalue_reference_impl<_Tp, true> { + typedef _LIBCPP_NODEBUG _Tp& type; +}; + +template +using __add_lvalue_reference_t = typename __add_lvalue_reference_impl<_Tp>::type; -template struct _LIBCPP_TEMPLATE_VIS add_lvalue_reference -{typedef _LIBCPP_NODEBUG typename __add_lvalue_reference_impl<_Tp>::type type;}; #endif // __has_builtin(__add_lvalue_reference) +template +struct add_lvalue_reference { + using type _LIBCPP_NODEBUG = __add_lvalue_reference_t<_Tp>; +}; + #if _LIBCPP_STD_VER > 11 -template using add_lvalue_reference_t = typename add_lvalue_reference<_Tp>::type; +template using add_lvalue_reference_t = __add_lvalue_reference_t<_Tp>; #endif _LIBCPP_END_NAMESPACE_STD diff --git a/libcxx/include/__type_traits/add_pointer.h b/libcxx/include/__type_traits/add_pointer.h --- a/libcxx/include/__type_traits/add_pointer.h +++ b/libcxx/include/__type_traits/add_pointer.h @@ -12,6 +12,7 @@ #include <__config> #include <__type_traits/is_referenceable.h> #include <__type_traits/is_same.h> +#include <__type_traits/is_void.h> #include <__type_traits/remove_cv.h> #include <__type_traits/remove_reference.h> @@ -22,25 +23,31 @@ _LIBCPP_BEGIN_NAMESPACE_STD #if __has_builtin(__add_pointer) + template -struct add_pointer { - using type _LIBCPP_NODEBUG = __add_pointer(_Tp); -}; +using __add_pointer_t = __add_pointer(_Tp); + #else template ::value || _IsSame::type, void>::value> + bool = __libcpp_is_referenceable<_Tp>::value || is_void<_Tp>::value> struct __add_pointer_impl { - typedef _LIBCPP_NODEBUG typename remove_reference<_Tp>::type* type; + typedef _LIBCPP_NODEBUG __libcpp_remove_reference_t<_Tp>* type; }; template struct __add_pointer_impl<_Tp, false> {typedef _LIBCPP_NODEBUG _Tp type;}; -template struct _LIBCPP_TEMPLATE_VIS add_pointer - {typedef _LIBCPP_NODEBUG typename __add_pointer_impl<_Tp>::type type;}; +template +using __add_pointer_t = typename __add_pointer_impl<_Tp>::type; + #endif // __has_builtin(__add_pointer) +template +struct add_pointer { + using type _LIBCPP_NODEBUG = __add_pointer_t<_Tp>; +}; + #if _LIBCPP_STD_VER > 11 -template using add_pointer_t = typename add_pointer<_Tp>::type; +template using add_pointer_t = __add_pointer_t<_Tp>; #endif _LIBCPP_END_NAMESPACE_STD diff --git a/libcxx/include/__type_traits/add_rvalue_reference.h b/libcxx/include/__type_traits/add_rvalue_reference.h --- a/libcxx/include/__type_traits/add_rvalue_reference.h +++ b/libcxx/include/__type_traits/add_rvalue_reference.h @@ -19,23 +19,34 @@ _LIBCPP_BEGIN_NAMESPACE_STD #if __has_builtin(__add_rvalue_reference) + template -struct add_rvalue_reference { - using type _LIBCPP_NODEBUG = __add_rvalue_reference(_Tp); -}; +using __add_rvalue_reference_t = __add_rvalue_reference(_Tp); + #else + template ::value> struct __add_rvalue_reference_impl { typedef _LIBCPP_NODEBUG _Tp type; }; -template struct __add_rvalue_reference_impl<_Tp, true> { typedef _LIBCPP_NODEBUG _Tp&& type; }; +template +struct __add_rvalue_reference_impl<_Tp, true> { + typedef _LIBCPP_NODEBUG _Tp&& type; +}; + +template +using __add_rvalue_reference_t = typename __add_rvalue_reference_impl<_Tp>::type; -template struct _LIBCPP_TEMPLATE_VIS add_rvalue_reference -{typedef _LIBCPP_NODEBUG typename __add_rvalue_reference_impl<_Tp>::type type;}; #endif // __has_builtin(__add_rvalue_reference) +template +struct add_rvalue_reference { + using type = __add_rvalue_reference_t<_Tp>; +}; + #if _LIBCPP_STD_VER > 11 -template using add_rvalue_reference_t = typename add_rvalue_reference<_Tp>::type; +template +using add_rvalue_reference_t = __add_rvalue_reference_t<_Tp>; #endif _LIBCPP_END_NAMESPACE_STD diff --git a/libcxx/include/__type_traits/apply_cv.h b/libcxx/include/__type_traits/apply_cv.h --- a/libcxx/include/__type_traits/apply_cv.h +++ b/libcxx/include/__type_traits/apply_cv.h @@ -21,8 +21,8 @@ _LIBCPP_BEGIN_NAMESPACE_STD -template ::type>::value, - bool = is_volatile::type>::value> +template >::value, + bool = is_volatile<__libcpp_remove_reference_t<_Tp> >::value> struct __apply_cv { typedef _LIBCPP_NODEBUG _Up type; diff --git a/libcxx/include/__type_traits/can_extract_key.h b/libcxx/include/__type_traits/can_extract_key.h --- a/libcxx/include/__type_traits/can_extract_key.h +++ b/libcxx/include/__type_traits/can_extract_key.h @@ -29,21 +29,21 @@ struct __extract_key_first_tag {}; template ::type> + class _RawValTy = __remove_const_ref_t<_ValTy> > struct __can_extract_key : conditional<_IsSame<_RawValTy, _Key>::value, __extract_key_self_tag, __extract_key_fail_tag>::type {}; template struct __can_extract_key<_Pair, _Key, pair<_First, _Second> > - : conditional<_IsSame::type, _Key>::value, + : conditional<_IsSame<__remove_const_t<_First>, _Key>::value, __extract_key_first_tag, __extract_key_fail_tag>::type {}; // __can_extract_map_key uses true_type/false_type instead of the tags. // It returns true if _Key != _ContainerValueTy (the container is a map not a set) // and _ValTy == _Key. template ::type> + class _RawValTy = __remove_const_ref_t<_ValTy> > struct __can_extract_map_key : integral_constant::value> {}; diff --git a/libcxx/include/__type_traits/copy_cvref.h b/libcxx/include/__type_traits/copy_cvref.h --- a/libcxx/include/__type_traits/copy_cvref.h +++ b/libcxx/include/__type_traits/copy_cvref.h @@ -29,13 +29,13 @@ template struct __copy_cvref<_From&, _To> { - using type = typename add_lvalue_reference<__copy_cv_t<_From, _To> >::type; + using type = __add_lvalue_reference_t<__copy_cv_t<_From, _To> >; }; template struct __copy_cvref<_From&&, _To> { - using type = typename add_rvalue_reference<__copy_cv_t<_From, _To> >::type; + using type = __add_rvalue_reference_t<__copy_cv_t<_From, _To> >; }; template diff --git a/libcxx/include/__type_traits/decay.h b/libcxx/include/__type_traits/decay.h --- a/libcxx/include/__type_traits/decay.h +++ b/libcxx/include/__type_traits/decay.h @@ -33,7 +33,7 @@ #else template struct __decay { - typedef _LIBCPP_NODEBUG typename remove_cv<_Up>::type type; + typedef _LIBCPP_NODEBUG __remove_cv_t<_Up> type; }; template @@ -42,12 +42,12 @@ typedef _LIBCPP_NODEBUG typename conditional < is_array<_Up>::value, - typename remove_extent<_Up>::type*, + __remove_extent_t<_Up>*, typename conditional < is_function<_Up>::value, typename add_pointer<_Up>::type, - typename remove_cv<_Up>::type + __remove_cv_t<_Up> >::type >::type type; }; @@ -56,7 +56,7 @@ struct _LIBCPP_TEMPLATE_VIS decay { private: - typedef _LIBCPP_NODEBUG typename remove_reference<_Tp>::type _Up; + typedef _LIBCPP_NODEBUG __libcpp_remove_reference_t<_Tp> _Up; public: typedef _LIBCPP_NODEBUG typename __decay<_Up, __libcpp_is_referenceable<_Up>::value>::type type; }; diff --git a/libcxx/include/__type_traits/is_convertible.h b/libcxx/include/__type_traits/is_convertible.h --- a/libcxx/include/__type_traits/is_convertible.h +++ b/libcxx/include/__type_traits/is_convertible.h @@ -53,7 +53,7 @@ } template ::type>::value> + unsigned = __is_convertible_imp::__is_array_function_or_void<__libcpp_remove_reference_t<_Tp> >::value> struct __is_convertible_check { static const size_t __v = 0; diff --git a/libcxx/include/__type_traits/is_copy_assignable.h b/libcxx/include/__type_traits/is_copy_assignable.h --- a/libcxx/include/__type_traits/is_copy_assignable.h +++ b/libcxx/include/__type_traits/is_copy_assignable.h @@ -24,8 +24,8 @@ struct _LIBCPP_TEMPLATE_VIS is_copy_assignable : public integral_constant< bool, - __is_assignable(typename add_lvalue_reference<_Tp>::type, - typename add_lvalue_reference::type>::type)> {}; + __is_assignable(__add_lvalue_reference_t<_Tp>, + __add_lvalue_reference_t::type>)> {}; #if _LIBCPP_STD_VER > 14 template diff --git a/libcxx/include/__type_traits/is_copy_constructible.h b/libcxx/include/__type_traits/is_copy_constructible.h --- a/libcxx/include/__type_traits/is_copy_constructible.h +++ b/libcxx/include/__type_traits/is_copy_constructible.h @@ -24,7 +24,7 @@ struct _LIBCPP_TEMPLATE_VIS is_copy_constructible : public integral_constant< bool, - __is_constructible(_Tp, typename add_lvalue_reference::type>::type)> {}; + __is_constructible(_Tp, __add_lvalue_reference_t::type>)> {}; #if _LIBCPP_STD_VER > 14 template diff --git a/libcxx/include/__type_traits/is_destructible.h b/libcxx/include/__type_traits/is_destructible.h --- a/libcxx/include/__type_traits/is_destructible.h +++ b/libcxx/include/__type_traits/is_destructible.h @@ -63,7 +63,7 @@ template struct __destructible_imp<_Tp, false> : public integral_constant::type>::value> {}; + __is_destructor_wellformed<__remove_all_extents_t<_Tp> >::value> {}; template struct __destructible_imp<_Tp, true> diff --git a/libcxx/include/__type_traits/is_floating_point.h b/libcxx/include/__type_traits/is_floating_point.h --- a/libcxx/include/__type_traits/is_floating_point.h +++ b/libcxx/include/__type_traits/is_floating_point.h @@ -25,7 +25,7 @@ template <> struct __libcpp_is_floating_point : public true_type {}; template struct _LIBCPP_TEMPLATE_VIS is_floating_point - : public __libcpp_is_floating_point::type> {}; + : public __libcpp_is_floating_point<__remove_cv_t<_Tp> > {}; #if _LIBCPP_STD_VER > 14 template diff --git a/libcxx/include/__type_traits/is_integral.h b/libcxx/include/__type_traits/is_integral.h --- a/libcxx/include/__type_traits/is_integral.h +++ b/libcxx/include/__type_traits/is_integral.h @@ -58,7 +58,7 @@ #else template struct _LIBCPP_TEMPLATE_VIS is_integral - : public _BoolConstant<__libcpp_is_integral::type>::value> {}; + : public _BoolConstant<__libcpp_is_integral<__remove_cv_t<_Tp> >::value> {}; #if _LIBCPP_STD_VER > 14 template diff --git a/libcxx/include/__type_traits/is_member_function_pointer.h b/libcxx/include/__type_traits/is_member_function_pointer.h --- a/libcxx/include/__type_traits/is_member_function_pointer.h +++ b/libcxx/include/__type_traits/is_member_function_pointer.h @@ -50,7 +50,7 @@ #else // __has_builtin(__is_member_function_pointer) template struct _LIBCPP_TEMPLATE_VIS is_member_function_pointer - : public _BoolConstant< __libcpp_is_member_pointer::type>::__is_func > {}; + : public _BoolConstant< __libcpp_is_member_pointer<__remove_cv_t<_Tp> >::__is_func > {}; #if _LIBCPP_STD_VER > 14 template diff --git a/libcxx/include/__type_traits/is_member_object_pointer.h b/libcxx/include/__type_traits/is_member_object_pointer.h --- a/libcxx/include/__type_traits/is_member_object_pointer.h +++ b/libcxx/include/__type_traits/is_member_object_pointer.h @@ -32,7 +32,7 @@ #else // __has_builtin(__is_member_object_pointer) template struct _LIBCPP_TEMPLATE_VIS is_member_object_pointer - : public _BoolConstant< __libcpp_is_member_pointer::type>::__is_obj > {}; + : public _BoolConstant< __libcpp_is_member_pointer<__remove_cv_t<_Tp> >::__is_obj > {}; #if _LIBCPP_STD_VER > 14 template diff --git a/libcxx/include/__type_traits/is_member_pointer.h b/libcxx/include/__type_traits/is_member_pointer.h --- a/libcxx/include/__type_traits/is_member_pointer.h +++ b/libcxx/include/__type_traits/is_member_pointer.h @@ -31,7 +31,7 @@ #else // __has_builtin(__is_member_pointer) template struct _LIBCPP_TEMPLATE_VIS is_member_pointer - : public _BoolConstant< __libcpp_is_member_pointer::type>::__is_member > {}; + : public _BoolConstant< __libcpp_is_member_pointer<__remove_cv_t<_Tp> >::__is_member > {}; #if _LIBCPP_STD_VER > 14 template diff --git a/libcxx/include/__type_traits/is_move_assignable.h b/libcxx/include/__type_traits/is_move_assignable.h --- a/libcxx/include/__type_traits/is_move_assignable.h +++ b/libcxx/include/__type_traits/is_move_assignable.h @@ -24,7 +24,7 @@ struct _LIBCPP_TEMPLATE_VIS is_move_assignable : public integral_constant< bool, - __is_assignable(typename add_lvalue_reference<_Tp>::type, typename add_rvalue_reference<_Tp>::type)> {}; + __is_assignable(__add_lvalue_reference_t<_Tp>, __add_rvalue_reference_t<_Tp>)> {}; #if _LIBCPP_STD_VER > 14 template diff --git a/libcxx/include/__type_traits/is_move_constructible.h b/libcxx/include/__type_traits/is_move_constructible.h --- a/libcxx/include/__type_traits/is_move_constructible.h +++ b/libcxx/include/__type_traits/is_move_constructible.h @@ -21,7 +21,7 @@ template struct _LIBCPP_TEMPLATE_VIS is_move_constructible - : public integral_constant::type)> + : public integral_constant)> {}; #if _LIBCPP_STD_VER > 14 diff --git a/libcxx/include/__type_traits/is_nothrow_copy_assignable.h b/libcxx/include/__type_traits/is_nothrow_copy_assignable.h --- a/libcxx/include/__type_traits/is_nothrow_copy_assignable.h +++ b/libcxx/include/__type_traits/is_nothrow_copy_assignable.h @@ -25,8 +25,8 @@ : public integral_constant< bool, __is_nothrow_assignable( - typename add_lvalue_reference<_Tp>::type, - typename add_lvalue_reference::type>::type)> {}; + __add_lvalue_reference_t<_Tp>, + __add_lvalue_reference_t::type>)> {}; #if _LIBCPP_STD_VER > 14 template diff --git a/libcxx/include/__type_traits/is_nothrow_copy_constructible.h b/libcxx/include/__type_traits/is_nothrow_copy_constructible.h --- a/libcxx/include/__type_traits/is_nothrow_copy_constructible.h +++ b/libcxx/include/__type_traits/is_nothrow_copy_constructible.h @@ -26,7 +26,7 @@ template struct _LIBCPP_TEMPLATE_VIS is_nothrow_copy_constructible : public is_nothrow_constructible<_Tp, - typename add_lvalue_reference::type>::type> {}; + __add_lvalue_reference_t::type> > {}; #else // _LIBCPP_COMPILER_GCC diff --git a/libcxx/include/__type_traits/is_nothrow_destructible.h b/libcxx/include/__type_traits/is_nothrow_destructible.h --- a/libcxx/include/__type_traits/is_nothrow_destructible.h +++ b/libcxx/include/__type_traits/is_nothrow_destructible.h @@ -71,7 +71,7 @@ is_reference<_Tp>::value> {}; template struct _LIBCPP_TEMPLATE_VIS is_nothrow_destructible - : public __libcpp_nothrow_destructor::type> {}; + : public __libcpp_nothrow_destructor<__remove_all_extents_t<_Tp> > {}; template struct _LIBCPP_TEMPLATE_VIS is_nothrow_destructible<_Tp[]> diff --git a/libcxx/include/__type_traits/is_nothrow_move_assignable.h b/libcxx/include/__type_traits/is_nothrow_move_assignable.h --- a/libcxx/include/__type_traits/is_nothrow_move_assignable.h +++ b/libcxx/include/__type_traits/is_nothrow_move_assignable.h @@ -24,7 +24,7 @@ struct _LIBCPP_TEMPLATE_VIS is_nothrow_move_assignable : public integral_constant< bool, - __is_nothrow_assignable(typename add_lvalue_reference<_Tp>::type, typename add_rvalue_reference<_Tp>::type)> { + __is_nothrow_assignable(__add_lvalue_reference_t<_Tp>, __add_rvalue_reference_t<_Tp>)> { }; #if _LIBCPP_STD_VER > 14 diff --git a/libcxx/include/__type_traits/is_nothrow_move_constructible.h b/libcxx/include/__type_traits/is_nothrow_move_constructible.h --- a/libcxx/include/__type_traits/is_nothrow_move_constructible.h +++ b/libcxx/include/__type_traits/is_nothrow_move_constructible.h @@ -24,13 +24,13 @@ #ifndef _LIBCPP_COMPILER_GCC template struct _LIBCPP_TEMPLATE_VIS is_nothrow_move_constructible - : public integral_constant::type)> + : public integral_constant)> {}; #else // _LIBCPP_COMPILER_GCC template struct _LIBCPP_TEMPLATE_VIS is_nothrow_move_constructible - : public is_nothrow_constructible<_Tp, typename add_rvalue_reference<_Tp>::type> + : public is_nothrow_constructible<_Tp, __add_rvalue_reference_t<_Tp> > {}; #endif // _LIBCPP_COMPILER_GCC diff --git a/libcxx/include/__type_traits/is_null_pointer.h b/libcxx/include/__type_traits/is_null_pointer.h --- a/libcxx/include/__type_traits/is_null_pointer.h +++ b/libcxx/include/__type_traits/is_null_pointer.h @@ -24,11 +24,11 @@ template <> struct __is_nullptr_t_impl : public true_type {}; template struct _LIBCPP_TEMPLATE_VIS __is_nullptr_t - : public __is_nullptr_t_impl::type> {}; + : public __is_nullptr_t_impl<__remove_cv_t<_Tp> > {}; #if _LIBCPP_STD_VER > 11 template struct _LIBCPP_TEMPLATE_VIS is_null_pointer - : public __is_nullptr_t_impl::type> {}; + : public __is_nullptr_t_impl<__remove_cv_t<_Tp> > {}; #if _LIBCPP_STD_VER > 14 template diff --git a/libcxx/include/__type_traits/is_pointer.h b/libcxx/include/__type_traits/is_pointer.h --- a/libcxx/include/__type_traits/is_pointer.h +++ b/libcxx/include/__type_traits/is_pointer.h @@ -43,7 +43,7 @@ #endif template struct _LIBCPP_TEMPLATE_VIS is_pointer - : public __libcpp_is_pointer::type>::type> {}; + : public __libcpp_is_pointer >::type> {}; #if _LIBCPP_STD_VER > 14 template diff --git a/libcxx/include/__type_traits/is_reference_wrapper.h b/libcxx/include/__type_traits/is_reference_wrapper.h --- a/libcxx/include/__type_traits/is_reference_wrapper.h +++ b/libcxx/include/__type_traits/is_reference_wrapper.h @@ -24,7 +24,7 @@ template struct __is_reference_wrapper_impl : public false_type {}; template struct __is_reference_wrapper_impl > : public true_type {}; template struct __is_reference_wrapper - : public __is_reference_wrapper_impl::type> {}; + : public __is_reference_wrapper_impl<__remove_cv_t<_Tp> > {}; _LIBCPP_END_NAMESPACE_STD diff --git a/libcxx/include/__type_traits/is_swappable.h b/libcxx/include/__type_traits/is_swappable.h --- a/libcxx/include/__type_traits/is_swappable.h +++ b/libcxx/include/__type_traits/is_swappable.h @@ -121,8 +121,8 @@ : public conditional< __libcpp_is_referenceable<_Tp>::value, is_swappable_with< - typename add_lvalue_reference<_Tp>::type, - typename add_lvalue_reference<_Tp>::type>, + __add_lvalue_reference_t<_Tp>, + __add_lvalue_reference_t<_Tp> >, false_type >::type { @@ -139,8 +139,8 @@ : public conditional< __libcpp_is_referenceable<_Tp>::value, is_nothrow_swappable_with< - typename add_lvalue_reference<_Tp>::type, - typename add_lvalue_reference<_Tp>::type>, + __add_lvalue_reference_t<_Tp>, + __add_lvalue_reference_t<_Tp> >, false_type >::type { diff --git a/libcxx/include/__type_traits/is_trivially_copy_assignable.h b/libcxx/include/__type_traits/is_trivially_copy_assignable.h --- a/libcxx/include/__type_traits/is_trivially_copy_assignable.h +++ b/libcxx/include/__type_traits/is_trivially_copy_assignable.h @@ -25,8 +25,8 @@ : public integral_constant< bool, __is_trivially_assignable( - typename add_lvalue_reference<_Tp>::type, - typename add_lvalue_reference::type>::type)> {}; + __add_lvalue_reference_t<_Tp>, + __add_lvalue_reference_t::type>)> {}; #if _LIBCPP_STD_VER > 14 template diff --git a/libcxx/include/__type_traits/is_trivially_copy_constructible.h b/libcxx/include/__type_traits/is_trivially_copy_constructible.h --- a/libcxx/include/__type_traits/is_trivially_copy_constructible.h +++ b/libcxx/include/__type_traits/is_trivially_copy_constructible.h @@ -20,7 +20,7 @@ _LIBCPP_BEGIN_NAMESPACE_STD template struct _LIBCPP_TEMPLATE_VIS is_trivially_copy_constructible - : public integral_constant::type)> + : public integral_constant)> {}; #if _LIBCPP_STD_VER > 14 diff --git a/libcxx/include/__type_traits/is_trivially_move_assignable.h b/libcxx/include/__type_traits/is_trivially_move_assignable.h --- a/libcxx/include/__type_traits/is_trivially_move_assignable.h +++ b/libcxx/include/__type_traits/is_trivially_move_assignable.h @@ -24,8 +24,7 @@ struct _LIBCPP_TEMPLATE_VIS is_trivially_move_assignable : public integral_constant< bool, - __is_trivially_assignable( - typename add_lvalue_reference<_Tp>::type, typename add_rvalue_reference<_Tp>::type)> {}; + __is_trivially_assignable(__add_lvalue_reference_t<_Tp>, __add_rvalue_reference_t<_Tp>)> {}; #if _LIBCPP_STD_VER > 14 template diff --git a/libcxx/include/__type_traits/is_trivially_move_constructible.h b/libcxx/include/__type_traits/is_trivially_move_constructible.h --- a/libcxx/include/__type_traits/is_trivially_move_constructible.h +++ b/libcxx/include/__type_traits/is_trivially_move_constructible.h @@ -21,7 +21,7 @@ template struct _LIBCPP_TEMPLATE_VIS is_trivially_move_constructible - : public integral_constant::type)> {}; + : public integral_constant)> {}; #if _LIBCPP_STD_VER > 14 template diff --git a/libcxx/include/__type_traits/is_void.h b/libcxx/include/__type_traits/is_void.h --- a/libcxx/include/__type_traits/is_void.h +++ b/libcxx/include/__type_traits/is_void.h @@ -31,7 +31,7 @@ #else template struct _LIBCPP_TEMPLATE_VIS is_void - : public is_same::type, void> {}; + : public is_same<__remove_cv_t<_Tp>, void> {}; #if _LIBCPP_STD_VER > 14 template diff --git a/libcxx/include/__type_traits/make_const_lvalue_ref.h b/libcxx/include/__type_traits/make_const_lvalue_ref.h --- a/libcxx/include/__type_traits/make_const_lvalue_ref.h +++ b/libcxx/include/__type_traits/make_const_lvalue_ref.h @@ -19,7 +19,7 @@ _LIBCPP_BEGIN_NAMESPACE_STD template -using __make_const_lvalue_ref = const typename remove_reference<_Tp>::type&; +using __make_const_lvalue_ref = const __libcpp_remove_reference_t<_Tp>&; _LIBCPP_END_NAMESPACE_STD diff --git a/libcxx/include/__type_traits/make_signed.h b/libcxx/include/__type_traits/make_signed.h --- a/libcxx/include/__type_traits/make_signed.h +++ b/libcxx/include/__type_traits/make_signed.h @@ -24,10 +24,10 @@ _LIBCPP_BEGIN_NAMESPACE_STD #if __has_builtin(__make_signed) + template -struct make_signed { - using type _LIBCPP_NODEBUG = __make_signed(_Tp); -}; +using __make_signed_t = __make_signed(_Tp); + #else typedef __type_list -struct _LIBCPP_TEMPLATE_VIS make_signed -{ - typedef typename __apply_cv<_Tp, typename __make_signed::type>::type>::type type; -}; +using __make_signed_t = typename __apply_cv<_Tp, typename __make_signed<__remove_cv_t<_Tp> >::type>::type; + #endif // __has_builtin(__make_signed) +template +struct make_signed { + using type _LIBCPP_NODEBUG = __make_signed_t<_Tp>; +}; + #if _LIBCPP_STD_VER > 11 -template using make_signed_t = typename make_signed<_Tp>::type; +template using make_signed_t = __make_signed_t<_Tp>; #endif _LIBCPP_END_NAMESPACE_STD diff --git a/libcxx/include/__type_traits/make_unsigned.h b/libcxx/include/__type_traits/make_unsigned.h --- a/libcxx/include/__type_traits/make_unsigned.h +++ b/libcxx/include/__type_traits/make_unsigned.h @@ -26,10 +26,10 @@ _LIBCPP_BEGIN_NAMESPACE_STD #if __has_builtin(__make_unsigned) + template -struct make_unsigned { - using type _LIBCPP_NODEBUG = __make_unsigned(_Tp); -}; +using __make_unsigned_t = __make_unsigned(_Tp); + #else typedef __type_list -struct _LIBCPP_TEMPLATE_VIS make_unsigned -{ - typedef typename __apply_cv<_Tp, typename __make_unsigned::type>::type>::type type; -}; +using __make_unsigned_t = typename __apply_cv<_Tp, typename __make_unsigned<__remove_cv_t<_Tp> >::type>::type; + #endif // __has_builtin(__make_unsigned) +template +struct make_unsigned { + using type _LIBCPP_NODEBUG = __make_unsigned_t<_Tp>; +}; + #if _LIBCPP_STD_VER > 11 -template using make_unsigned_t = typename make_unsigned<_Tp>::type; +template using make_unsigned_t = __make_unsigned_t<_Tp>; #endif #ifndef _LIBCPP_CXX03_LANG template _LIBCPP_HIDE_FROM_ABI constexpr -typename make_unsigned<_Tp>::type __to_unsigned_like(_Tp __x) noexcept { - return static_cast::type>(__x); +__make_unsigned_t<_Tp> __to_unsigned_like(_Tp __x) noexcept { + return static_cast<__make_unsigned_t<_Tp> >(__x); } #endif template -using __copy_unsigned_t = __conditional_t::value, typename make_unsigned<_Up>::type, _Up>; +using __copy_unsigned_t = __conditional_t::value, __make_unsigned_t<_Up>, _Up>; _LIBCPP_END_NAMESPACE_STD diff --git a/libcxx/include/__type_traits/remove_all_extents.h b/libcxx/include/__type_traits/remove_all_extents.h --- a/libcxx/include/__type_traits/remove_all_extents.h +++ b/libcxx/include/__type_traits/remove_all_extents.h @@ -23,6 +23,9 @@ struct remove_all_extents { using type _LIBCPP_NODEBUG = __remove_all_extents(_Tp); }; + +template +using __remove_all_extents_t = __remove_all_extents(_Tp); #else template struct _LIBCPP_TEMPLATE_VIS remove_all_extents {typedef _Tp type;}; @@ -30,10 +33,13 @@ {typedef typename remove_all_extents<_Tp>::type type;}; template struct _LIBCPP_TEMPLATE_VIS remove_all_extents<_Tp[_Np]> {typedef typename remove_all_extents<_Tp>::type type;}; + +template +using __remove_all_extents_t = typename remove_all_extents<_Tp>::type; #endif // __has_builtin(__remove_all_extents) #if _LIBCPP_STD_VER > 11 -template using remove_all_extents_t = typename remove_all_extents<_Tp>::type; +template using remove_all_extents_t = __remove_all_extents_t<_Tp>; #endif _LIBCPP_END_NAMESPACE_STD diff --git a/libcxx/include/__type_traits/remove_const.h b/libcxx/include/__type_traits/remove_const.h --- a/libcxx/include/__type_traits/remove_const.h +++ b/libcxx/include/__type_traits/remove_const.h @@ -22,13 +22,19 @@ struct remove_const { using type _LIBCPP_NODEBUG = __remove_const(_Tp); }; + +template +using __remove_const_t = __remove_const(_Tp); #else template struct _LIBCPP_TEMPLATE_VIS remove_const {typedef _Tp type;}; template struct _LIBCPP_TEMPLATE_VIS remove_const {typedef _Tp type;}; + +template +using __remove_const_t = typename remove_const<_Tp>::type; #endif // __has_builtin(__remove_const) #if _LIBCPP_STD_VER > 11 -template using remove_const_t = typename remove_const<_Tp>::type; +template using remove_const_t = __remove_const_t<_Tp>; #endif _LIBCPP_END_NAMESPACE_STD diff --git a/libcxx/include/__type_traits/remove_const_ref.h b/libcxx/include/__type_traits/remove_const_ref.h --- a/libcxx/include/__type_traits/remove_const_ref.h +++ b/libcxx/include/__type_traits/remove_const_ref.h @@ -20,9 +20,7 @@ _LIBCPP_BEGIN_NAMESPACE_STD template -struct __unconstref { - typedef _LIBCPP_NODEBUG typename remove_const::type>::type type; -}; +using __remove_const_ref_t = __remove_const_t<__libcpp_remove_reference_t<_Tp> >; _LIBCPP_END_NAMESPACE_STD diff --git a/libcxx/include/__type_traits/remove_cv.h b/libcxx/include/__type_traits/remove_cv.h --- a/libcxx/include/__type_traits/remove_cv.h +++ b/libcxx/include/__type_traits/remove_cv.h @@ -24,13 +24,19 @@ struct remove_cv { using type _LIBCPP_NODEBUG = __remove_cv(_Tp); }; + +template +using __remove_cv_t = __remove_cv(_Tp); #else template struct _LIBCPP_TEMPLATE_VIS remove_cv -{typedef typename remove_volatile::type>::type type;}; +{typedef __remove_volatile_t<__remove_const_t<_Tp> > type;}; + +template +using __remove_cv_t = __remove_volatile_t<__remove_const_t<_Tp> >; #endif // __has_builtin(__remove_cv) #if _LIBCPP_STD_VER > 11 -template using remove_cv_t = typename remove_cv<_Tp>::type; +template using remove_cv_t = __remove_cv_t<_Tp>; #endif _LIBCPP_END_NAMESPACE_STD diff --git a/libcxx/include/__type_traits/remove_cvref.h b/libcxx/include/__type_traits/remove_cvref.h --- a/libcxx/include/__type_traits/remove_cvref.h +++ b/libcxx/include/__type_traits/remove_cvref.h @@ -22,23 +22,22 @@ #if __has_builtin(__remove_cvref) template -using __uncvref_t _LIBCPP_NODEBUG = __remove_cvref(_Tp); +using __remove_cvref_t _LIBCPP_NODEBUG = __remove_cvref(_Tp); #else template -using __uncvref_t _LIBCPP_NODEBUG = typename remove_cv::type>::type; +using __remove_cvref_t _LIBCPP_NODEBUG = __remove_cv_t<__libcpp_remove_reference_t<_Tp> >; #endif // __has_builtin(__remove_cvref) template -struct __is_same_uncvref : _IsSame<__uncvref_t<_Tp>, __uncvref_t<_Up> > {}; +struct __is_same_uncvref : _IsSame<__remove_cvref_t<_Tp>, __remove_cvref_t<_Up> > {}; #if _LIBCPP_STD_VER > 17 -// remove_cvref - same as __uncvref template struct remove_cvref { - using type _LIBCPP_NODEBUG = __uncvref_t<_Tp>; + using type _LIBCPP_NODEBUG = __remove_cvref_t<_Tp>; }; -template using remove_cvref_t = typename remove_cvref<_Tp>::type; +template using remove_cvref_t = __remove_cvref_t<_Tp>; #endif _LIBCPP_END_NAMESPACE_STD diff --git a/libcxx/include/__type_traits/remove_extent.h b/libcxx/include/__type_traits/remove_extent.h --- a/libcxx/include/__type_traits/remove_extent.h +++ b/libcxx/include/__type_traits/remove_extent.h @@ -23,6 +23,9 @@ struct remove_extent { using type _LIBCPP_NODEBUG = __remove_extent(_Tp); }; + +template +using __remove_extent_t = __remove_extent(_Tp); #else template struct _LIBCPP_TEMPLATE_VIS remove_extent {typedef _Tp type;}; @@ -30,10 +33,13 @@ {typedef _Tp type;}; template struct _LIBCPP_TEMPLATE_VIS remove_extent<_Tp[_Np]> {typedef _Tp type;}; + +template +using __remove_extent_t = typename remove_extent<_Tp>::type; #endif // __has_builtin(__remove_extent) #if _LIBCPP_STD_VER > 11 -template using remove_extent_t = typename remove_extent<_Tp>::type; +template using remove_extent_t = __remove_extent_t<_Tp>; #endif _LIBCPP_END_NAMESPACE_STD diff --git a/libcxx/include/__type_traits/remove_pointer.h b/libcxx/include/__type_traits/remove_pointer.h --- a/libcxx/include/__type_traits/remove_pointer.h +++ b/libcxx/include/__type_traits/remove_pointer.h @@ -22,16 +22,22 @@ struct remove_pointer { using type _LIBCPP_NODEBUG = __remove_pointer(_Tp); }; + +template +using __remove_pointer_t = __remove_pointer(_Tp); #else template struct _LIBCPP_TEMPLATE_VIS remove_pointer {typedef _LIBCPP_NODEBUG _Tp type;}; template struct _LIBCPP_TEMPLATE_VIS remove_pointer<_Tp*> {typedef _LIBCPP_NODEBUG _Tp type;}; template struct _LIBCPP_TEMPLATE_VIS remove_pointer<_Tp* const> {typedef _LIBCPP_NODEBUG _Tp type;}; template struct _LIBCPP_TEMPLATE_VIS remove_pointer<_Tp* volatile> {typedef _LIBCPP_NODEBUG _Tp type;}; template struct _LIBCPP_TEMPLATE_VIS remove_pointer<_Tp* const volatile> {typedef _LIBCPP_NODEBUG _Tp type;}; + +template +using __remove_pointer_t = typename remove_pointer<_Tp>::type; #endif // __has_builtin(__remove_pointer) #if _LIBCPP_STD_VER > 11 -template using remove_pointer_t = typename remove_pointer<_Tp>::type; +template using remove_pointer_t = __remove_pointer_t<_Tp>; #endif _LIBCPP_END_NAMESPACE_STD diff --git a/libcxx/include/__type_traits/remove_reference.h b/libcxx/include/__type_traits/remove_reference.h --- a/libcxx/include/__type_traits/remove_reference.h +++ b/libcxx/include/__type_traits/remove_reference.h @@ -23,14 +23,20 @@ struct remove_reference { using type _LIBCPP_NODEBUG = __remove_reference_t(_Tp); }; + +template +using __libcpp_remove_reference_t = __remove_reference_t(_Tp); #else template struct _LIBCPP_TEMPLATE_VIS remove_reference {typedef _LIBCPP_NODEBUG _Tp type;}; template struct _LIBCPP_TEMPLATE_VIS remove_reference<_Tp&> {typedef _LIBCPP_NODEBUG _Tp type;}; template struct _LIBCPP_TEMPLATE_VIS remove_reference<_Tp&&> {typedef _LIBCPP_NODEBUG _Tp type;}; + +template +using __libcpp_remove_reference_t = typename remove_reference<_Tp>::type; #endif // __has_builtin(__remove_reference_t) #if _LIBCPP_STD_VER > 11 -template using remove_reference_t = typename remove_reference<_Tp>::type; +template using remove_reference_t = __libcpp_remove_reference_t<_Tp>; #endif _LIBCPP_END_NAMESPACE_STD diff --git a/libcxx/include/__type_traits/remove_volatile.h b/libcxx/include/__type_traits/remove_volatile.h --- a/libcxx/include/__type_traits/remove_volatile.h +++ b/libcxx/include/__type_traits/remove_volatile.h @@ -22,13 +22,19 @@ struct remove_volatile { using type _LIBCPP_NODEBUG = __remove_volatile(_Tp); }; + +template +using __remove_volatile_t = __remove_volatile(_Tp); #else template struct _LIBCPP_TEMPLATE_VIS remove_volatile {typedef _Tp type;}; template struct _LIBCPP_TEMPLATE_VIS remove_volatile {typedef _Tp type;}; + +template +using __remove_volatile_t = typename remove_volatile<_Tp>::type; #endif // __has_builtin(__remove_volatile) #if _LIBCPP_STD_VER > 11 -template using remove_volatile_t = typename remove_volatile<_Tp>::type; +template using remove_volatile_t = __remove_volatile_t<_Tp>; #endif _LIBCPP_END_NAMESPACE_STD diff --git a/libcxx/include/__utility/forward.h b/libcxx/include/__utility/forward.h --- a/libcxx/include/__utility/forward.h +++ b/libcxx/include/__utility/forward.h @@ -22,13 +22,13 @@ template _LIBCPP_NODISCARD_EXT inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR _Tp&& -forward(typename remove_reference<_Tp>::type& __t) _NOEXCEPT { +forward(__libcpp_remove_reference_t<_Tp>& __t) _NOEXCEPT { return static_cast<_Tp&&>(__t); } template _LIBCPP_NODISCARD_EXT inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR _Tp&& -forward(typename remove_reference<_Tp>::type&& __t) _NOEXCEPT { +forward(__libcpp_remove_reference_t<_Tp>&& __t) _NOEXCEPT { static_assert(!is_lvalue_reference<_Tp>::value, "cannot forward an rvalue as an lvalue"); return static_cast<_Tp&&>(__t); } diff --git a/libcxx/include/__utility/in_place.h b/libcxx/include/__utility/in_place.h --- a/libcxx/include/__utility/in_place.h +++ b/libcxx/include/__utility/in_place.h @@ -43,13 +43,13 @@ template struct __is_inplace_type_imp> : true_type {}; template -using __is_inplace_type = __is_inplace_type_imp<__uncvref_t<_Tp>>; +using __is_inplace_type = __is_inplace_type_imp<__remove_cvref_t<_Tp>>; template struct __is_inplace_index_imp : false_type {}; template struct __is_inplace_index_imp> : true_type {}; template -using __is_inplace_index = __is_inplace_index_imp<__uncvref_t<_Tp>>; +using __is_inplace_index = __is_inplace_index_imp<__remove_cvref_t<_Tp>>; #endif // _LIBCPP_STD_VER > 14 diff --git a/libcxx/include/__utility/move.h b/libcxx/include/__utility/move.h --- a/libcxx/include/__utility/move.h +++ b/libcxx/include/__utility/move.h @@ -20,9 +20,9 @@ _LIBCPP_BEGIN_NAMESPACE_STD template -_LIBCPP_NODISCARD_EXT inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR typename remove_reference<_Tp>::type&& +_LIBCPP_NODISCARD_EXT inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR __libcpp_remove_reference_t<_Tp>&& move(_Tp&& __t) _NOEXCEPT { - typedef _LIBCPP_NODEBUG typename remove_reference<_Tp>::type _Up; + typedef _LIBCPP_NODEBUG __libcpp_remove_reference_t<_Tp> _Up; return static_cast<_Up&&>(__t); } diff --git a/libcxx/include/any b/libcxx/include/any --- a/libcxx/include/any +++ b/libcxx/include/any @@ -605,7 +605,7 @@ _LIBCPP_AVAILABILITY_THROW_BAD_ANY_CAST _ValueType any_cast(any const & __v) { - using _RawValueType = __uncvref_t<_ValueType>; + using _RawValueType = __remove_cvref_t<_ValueType>; static_assert(is_constructible<_ValueType, _RawValueType const &>::value, "ValueType is required to be a const lvalue reference " "or a CopyConstructible type"); @@ -620,7 +620,7 @@ _LIBCPP_AVAILABILITY_THROW_BAD_ANY_CAST _ValueType any_cast(any & __v) { - using _RawValueType = __uncvref_t<_ValueType>; + using _RawValueType = __remove_cvref_t<_ValueType>; static_assert(is_constructible<_ValueType, _RawValueType &>::value, "ValueType is required to be an lvalue reference " "or a CopyConstructible type"); @@ -635,7 +635,7 @@ _LIBCPP_AVAILABILITY_THROW_BAD_ANY_CAST _ValueType any_cast(any && __v) { - using _RawValueType = __uncvref_t<_ValueType>; + using _RawValueType = __remove_cvref_t<_ValueType>; static_assert(is_constructible<_ValueType, _RawValueType>::value, "ValueType is required to be an rvalue reference " "or a CopyConstructible type"); @@ -675,7 +675,7 @@ using __any_imp::_Action; static_assert(!is_reference<_ValueType>::value, "_ValueType may not be a reference."); - typedef typename add_pointer<_ValueType>::type _ReturnType; + typedef add_pointer_t<_ValueType> _ReturnType; if (__any && __any->__h_) { void *__p = __any->__call(_Action::_Get, nullptr, #if !defined(_LIBCPP_NO_RTTI) diff --git a/libcxx/include/atomic b/libcxx/include/atomic --- a/libcxx/include/atomic +++ b/libcxx/include/atomic @@ -944,13 +944,13 @@ template _LIBCPP_INLINE_VISIBILITY _Tp __cxx_atomic_load(__cxx_atomic_base_impl<_Tp> const volatile* __a, memory_order __order) _NOEXCEPT { - using __ptr_type = typename remove_const__a_value)>::type*; + using __ptr_type = __remove_const_t__a_value)>*; return __c11_atomic_load(const_cast<__ptr_type>(&__a->__a_value), static_cast<__memory_order_underlying_t>(__order)); } template _LIBCPP_INLINE_VISIBILITY _Tp __cxx_atomic_load(__cxx_atomic_base_impl<_Tp> const* __a, memory_order __order) _NOEXCEPT { - using __ptr_type = typename remove_const__a_value)>::type*; + using __ptr_type = __remove_const_t__a_value)>*; return __c11_atomic_load(const_cast<__ptr_type>(&__a->__a_value), static_cast<__memory_order_underlying_t>(__order)); } @@ -1802,28 +1802,28 @@ _LIBCPP_INLINE_VISIBILITY _Tp* fetch_add(ptrdiff_t __op, memory_order __m = memory_order_seq_cst) volatile _NOEXCEPT { // __atomic_fetch_add accepts function pointers, guard against them. - static_assert(!is_function::type>::value, "Pointer to function isn't allowed"); + static_assert(!is_function<__remove_pointer_t<_Tp> >::value, "Pointer to function isn't allowed"); return __cxx_atomic_fetch_add(&this->__a_, __op, __m); } _LIBCPP_INLINE_VISIBILITY _Tp* fetch_add(ptrdiff_t __op, memory_order __m = memory_order_seq_cst) _NOEXCEPT { // __atomic_fetch_add accepts function pointers, guard against them. - static_assert(!is_function::type>::value, "Pointer to function isn't allowed"); + static_assert(!is_function<__remove_pointer_t<_Tp> >::value, "Pointer to function isn't allowed"); return __cxx_atomic_fetch_add(&this->__a_, __op, __m); } _LIBCPP_INLINE_VISIBILITY _Tp* fetch_sub(ptrdiff_t __op, memory_order __m = memory_order_seq_cst) volatile _NOEXCEPT { // __atomic_fetch_add accepts function pointers, guard against them. - static_assert(!is_function::type>::value, "Pointer to function isn't allowed"); + static_assert(!is_function<__remove_pointer_t<_Tp> >::value, "Pointer to function isn't allowed"); return __cxx_atomic_fetch_sub(&this->__a_, __op, __m); } _LIBCPP_INLINE_VISIBILITY _Tp* fetch_sub(ptrdiff_t __op, memory_order __m = memory_order_seq_cst) _NOEXCEPT { // __atomic_fetch_add accepts function pointers, guard against them. - static_assert(!is_function::type>::value, "Pointer to function isn't allowed"); + static_assert(!is_function<__remove_pointer_t<_Tp> >::value, "Pointer to function isn't allowed"); return __cxx_atomic_fetch_sub(&this->__a_, __op, __m); } diff --git a/libcxx/include/experimental/coroutine b/libcxx/include/experimental/coroutine --- a/libcxx/include/experimental/coroutine +++ b/libcxx/include/experimental/coroutine @@ -259,7 +259,7 @@ _LIBCPP_INLINE_VISIBILITY static coroutine_handle from_promise(_Promise& __promise) _NOEXCEPT { - typedef typename remove_cv<_Promise>::type _RawPromise; + typedef __remove_cv_t<_Promise> _RawPromise; coroutine_handle __tmp; __tmp.__handle_ = __builtin_coro_promise( _VSTD::addressof(const_cast<_RawPromise&>(__promise)), diff --git a/libcxx/include/experimental/functional b/libcxx/include/experimental/functional --- a/libcxx/include/experimental/functional +++ b/libcxx/include/experimental/functional @@ -161,7 +161,7 @@ typedef _Value value_type; typedef _Key key_type; - typedef typename make_unsigned::type unsigned_key_type; + typedef __make_unsigned_t unsigned_key_type; typedef std::array skip_map; skip_map __table_; diff --git a/libcxx/include/experimental/propagate_const b/libcxx/include/experimental/propagate_const --- a/libcxx/include/experimental/propagate_const +++ b/libcxx/include/experimental/propagate_const @@ -145,9 +145,9 @@ "Instantiation of propagate_const with an array type is ill-formed."); static_assert(!is_reference<_Tp>::value, "Instantiation of propagate_const with a reference type is ill-formed."); - static_assert(!(is_pointer<_Tp>::value && is_function::type>::value), + static_assert(!(is_pointer<_Tp>::value && is_function<__remove_pointer_t<_Tp> >::value), "Instantiation of propagate_const with a function-pointer type is ill-formed."); - static_assert(!(is_pointer<_Tp>::value && is_same::type>::type, void>::value), + static_assert(!(is_pointer<_Tp>::value && is_same<__remove_cv_t<__remove_pointer_t<_Tp> >, void>::value), "Instantiation of propagate_const with a pointer to (possibly cv-qualified) void is ill-formed."); private: diff --git a/libcxx/include/experimental/simd b/libcxx/include/experimental/simd --- a/libcxx/include/experimental/simd +++ b/libcxx/include/experimental/simd @@ -1057,7 +1057,7 @@ : std::integral_constant { static_assert( std::is_arithmetic<_Tp>::value && - !std::is_same::type, bool>::value, + !std::is_same<__remove_const_t<_Tp>, bool>::value, "Element type should be vectorizable"); }; @@ -1299,7 +1299,7 @@ public: const_where_expression(const const_where_expression&) = delete; const_where_expression& operator=(const const_where_expression&) = delete; - typename remove_const<_Tp>::type operator-() const&&; + __remove_const_t<_Tp> operator-() const&&; template void copy_to(_Up*, _Flags) const&&; }; @@ -1366,8 +1366,8 @@ __is_non_narrowing_arithmetic_convertible<_Up, _Tp>()) || (!std::is_arithmetic<_Up>::value && std::is_convertible<_Up, _Tp>::value) || - std::is_same::type, int>::value || - (std::is_same::type, + std::is_same<__remove_const_t<_Up>, int>::value || + (std::is_same<__remove_const_t<_Up>, unsigned int>::value && std::is_unsigned<_Tp>::value); } diff --git a/libcxx/include/ext/hash_map b/libcxx/include/ext/hash_map --- a/libcxx/include/ext/hash_map +++ b/libcxx/include/ext/hash_map @@ -378,7 +378,7 @@ typedef std::pair value_type; typedef typename _HashIterator::difference_type difference_type; typedef value_type& reference; - typedef typename std::__rebind_pointer::type + typedef std::__rebind_pointer_t pointer; _LIBCPP_INLINE_VISIBILITY __hash_map_iterator() {} @@ -423,7 +423,7 @@ typedef std::pair value_type; typedef typename _HashIterator::difference_type difference_type; typedef const value_type& reference; - typedef typename std::__rebind_pointer::type + typedef std::__rebind_pointer_t pointer; _LIBCPP_INLINE_VISIBILITY __hash_map_const_iterator() {} diff --git a/libcxx/include/forward_list b/libcxx/include/forward_list --- a/libcxx/include/forward_list +++ b/libcxx/include/forward_list @@ -241,14 +241,13 @@ template struct __forward_node_traits { - typedef typename remove_cv< - typename pointer_traits<_NodePtr>::element_type>::type __node; + typedef __remove_cv_t< + typename pointer_traits<_NodePtr>::element_type> __node; typedef typename __forward_list_node_value_type<__node>::type __node_value_type; typedef _NodePtr __node_pointer; typedef __forward_begin_node<_NodePtr> __begin_node; - typedef typename __rebind_pointer<_NodePtr, __begin_node>::type - __begin_node_pointer; - typedef typename __rebind_pointer<_NodePtr, void>::type __void_pointer; + typedef __rebind_pointer_t<_NodePtr, __begin_node> __begin_node_pointer; + typedef __rebind_pointer_t<_NodePtr, void> __void_pointer; #if defined(_LIBCPP_ABI_FORWARD_LIST_REMOVE_NODE_POINTER_UB) typedef __begin_node_pointer __iter_node_pointer; @@ -280,7 +279,7 @@ struct __forward_begin_node { typedef _NodePtr pointer; - typedef typename __rebind_pointer<_NodePtr, __forward_begin_node>::type __begin_node_pointer; + typedef __rebind_pointer_t<_NodePtr, __forward_begin_node> __begin_node_pointer; pointer __next_; @@ -296,7 +295,7 @@ struct _LIBCPP_HIDDEN __begin_node_of { typedef __forward_begin_node< - typename __rebind_pointer<_VoidPtr, __forward_list_node<_Tp, _VoidPtr> >::type + __rebind_pointer_t<_VoidPtr, __forward_list_node<_Tp, _VoidPtr> > > type; }; @@ -355,7 +354,7 @@ typedef value_type& reference; typedef typename pointer_traits<__node_pointer>::difference_type difference_type; - typedef typename __rebind_pointer<__node_pointer, value_type>::type pointer; + typedef __rebind_pointer_t<__node_pointer, value_type> pointer; _LIBCPP_INLINE_VISIBILITY __forward_list_iterator() _NOEXCEPT : __ptr_(nullptr) {} @@ -436,7 +435,7 @@ typedef const value_type& reference; typedef typename pointer_traits<__node_pointer>::difference_type difference_type; - typedef typename __rebind_pointer<__node_pointer, const value_type>::type + typedef __rebind_pointer_t<__node_pointer, const value_type> pointer; _LIBCPP_INLINE_VISIBILITY diff --git a/libcxx/include/future b/libcxx/include/future --- a/libcxx/include/future +++ b/libcxx/include/future @@ -637,7 +637,7 @@ void set_value_at_thread_exit(_Arg&& __arg); _Rp move(); - typename add_lvalue_reference<_Rp>::type copy(); + __add_lvalue_reference_t<_Rp> copy(); }; template @@ -688,7 +688,7 @@ } template -typename add_lvalue_reference<_Rp>::type +__add_lvalue_reference_t<_Rp> __assoc_state<_Rp>::copy() { unique_lock __lk(this->__mut_); @@ -1750,7 +1750,7 @@ __packaged_task_function<_Rp(_ArgTypes...)>::__packaged_task_function(_Fp&& __f) : __f_(nullptr) { - typedef typename remove_reference::type>::type _FR; + typedef __libcpp_remove_reference_t::type> _FR; typedef __packaged_task_func<_FR, allocator<_FR>, _Rp(_ArgTypes...)> _FF; if (sizeof(_FF) <= sizeof(__buf_)) { @@ -1774,7 +1774,7 @@ allocator_arg_t, const _Alloc& __a0, _Fp&& __f) : __f_(nullptr) { - typedef typename remove_reference::type>::type _FR; + typedef __libcpp_remove_reference_t::type> _FR; typedef __packaged_task_func<_FR, _Alloc, _Rp(_ArgTypes...)> _FF; if (sizeof(_FF) <= sizeof(__buf_)) { @@ -1887,11 +1887,11 @@ _LIBCPP_INLINE_VISIBILITY packaged_task() _NOEXCEPT : __p_(nullptr) {} template , packaged_task>::value> > + class = __enable_if_t, packaged_task>::value> > _LIBCPP_INLINE_VISIBILITY explicit packaged_task(_Fp&& __f) : __f_(_VSTD::forward<_Fp>(__f)) {} template , packaged_task>::value> > + 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)), @@ -2002,11 +2002,11 @@ _LIBCPP_INLINE_VISIBILITY packaged_task() _NOEXCEPT : __p_(nullptr) {} template , packaged_task>::value> > + class = __enable_if_t, packaged_task>::value> > _LIBCPP_INLINE_VISIBILITY explicit packaged_task(_Fp&& __f) : __f_(_VSTD::forward<_Fp>(__f)) {} template , packaged_task>::value> > + 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/limits b/libcxx/include/limits --- a/libcxx/include/limits +++ b/libcxx/include/limits @@ -451,9 +451,9 @@ template class _LIBCPP_TEMPLATE_VIS numeric_limits - : private __libcpp_numeric_limits::type> + : private __libcpp_numeric_limits<__remove_cv_t<_Tp> > { - typedef __libcpp_numeric_limits::type> __base; + typedef __libcpp_numeric_limits<__remove_cv_t<_Tp> > __base; typedef typename __base::type type; public: static _LIBCPP_CONSTEXPR const bool is_specialized = __base::is_specialized; diff --git a/libcxx/include/list b/libcxx/include/list --- a/libcxx/include/list +++ b/libcxx/include/list @@ -239,9 +239,9 @@ template struct __list_node_pointer_traits { - typedef typename __rebind_pointer<_VoidPtr, __list_node<_Tp, _VoidPtr> >::type + typedef __rebind_pointer_t<_VoidPtr, __list_node<_Tp, _VoidPtr> > __node_pointer; - typedef typename __rebind_pointer<_VoidPtr, __list_node_base<_Tp, _VoidPtr> >::type + typedef __rebind_pointer_t<_VoidPtr, __list_node_base<_Tp, _VoidPtr> > __base_pointer; #if defined(_LIBCPP_ABI_LIST_REMOVE_NODE_POINTER_UB) @@ -342,7 +342,7 @@ typedef bidirectional_iterator_tag iterator_category; typedef _Tp value_type; typedef value_type& reference; - typedef typename __rebind_pointer<_VoidPtr, value_type>::type pointer; + typedef __rebind_pointer_t<_VoidPtr, value_type> pointer; typedef typename pointer_traits::difference_type difference_type; _LIBCPP_INLINE_VISIBILITY @@ -450,7 +450,7 @@ typedef bidirectional_iterator_tag iterator_category; typedef _Tp value_type; typedef const value_type& reference; - typedef typename __rebind_pointer<_VoidPtr, const value_type>::type pointer; + typedef __rebind_pointer_t<_VoidPtr, const value_type> pointer; typedef typename pointer_traits::difference_type difference_type; _LIBCPP_INLINE_VISIBILITY diff --git a/libcxx/include/locale b/libcxx/include/locale --- a/libcxx/include/locale +++ b/libcxx/include/locale @@ -753,11 +753,11 @@ { if (__a != __a_end) { - typename remove_reference::type __save_errno = errno; + __libcpp_remove_reference_t __save_errno = errno; errno = 0; char *__p2; long long __ll = strtoll_l(__a, &__p2, __base, _LIBCPP_GET_C_LOCALE); - typename remove_reference::type __current_errno = errno; + __libcpp_remove_reference_t __current_errno = errno; if (__current_errno == 0) errno = __save_errno; if (__p2 != __a_end) @@ -793,11 +793,11 @@ __err = ios_base::failbit; return 0; } - typename remove_reference::type __save_errno = errno; + __libcpp_remove_reference_t __save_errno = errno; errno = 0; char *__p2; unsigned long long __ll = strtoull_l(__a, &__p2, __base, _LIBCPP_GET_C_LOCALE); - typename remove_reference::type __current_errno = errno; + __libcpp_remove_reference_t __current_errno = errno; if (__current_errno == 0) errno = __save_errno; if (__p2 != __a_end) @@ -847,11 +847,11 @@ { if (__a != __a_end) { - typename remove_reference::type __save_errno = errno; + __libcpp_remove_reference_t __save_errno = errno; errno = 0; char *__p2; _Tp __ld = __do_strtod<_Tp>(__a, &__p2); - typename remove_reference::type __current_errno = errno; + __libcpp_remove_reference_t __current_errno = errno; if (__current_errno == 0) errno = __save_errno; if (__p2 != __a_end) diff --git a/libcxx/include/new b/libcxx/include/new --- a/libcxx/include/new +++ b/libcxx/include/new @@ -365,7 +365,7 @@ _LIBCPP_CONSTEXPR _Tp* __launder(_Tp* __p) _NOEXCEPT { static_assert (!(is_function<_Tp>::value), "can't launder functions" ); - static_assert (!(is_same::type>::value), "can't launder cv-void" ); + static_assert (!(is_same >::value), "can't launder cv-void" ); return __builtin_launder(__p); } diff --git a/libcxx/include/optional b/libcxx/include/optional --- a/libcxx/include/optional +++ b/libcxx/include/optional @@ -402,14 +402,14 @@ template static constexpr bool __can_bind_reference() { - using _RawUp = typename remove_reference<_Up>::type; + using _RawUp = __libcpp_remove_reference_t<_Up>; using _UpPtr = _RawUp*; - using _RawTp = typename remove_reference<_Tp>::type; + using _RawTp = __libcpp_remove_reference_t<_Tp>; using _TpPtr = _RawTp*; using _CheckLValueArg = integral_constant::value && is_convertible<_UpPtr, _TpPtr>::value) || is_same<_RawUp, reference_wrapper<_RawTp>>::value - || is_same<_RawUp, reference_wrapper::type>>::value + || is_same<_RawUp, reference_wrapper<__remove_const_t<_RawTp>>>::value >; return (is_lvalue_reference<_Tp>::value && _CheckLValueArg::value) || (is_rvalue_reference<_Tp>::value && !is_lvalue_reference<_Up>::value && @@ -637,9 +637,9 @@ private: // Disable the reference extension using this static assert. - static_assert(!is_same_v<__uncvref_t, in_place_t>, + static_assert(!is_same_v<__remove_cvref_t, in_place_t>, "instantiation of optional with in_place_t is ill-formed"); - static_assert(!is_same_v<__uncvref_t, nullopt_t>, + static_assert(!is_same_v<__remove_cvref_t, nullopt_t>, "instantiation of optional with nullopt_t is ill-formed"); static_assert(!is_reference_v, "instantiation of optional with a reference type is ill-formed"); @@ -664,8 +664,8 @@ }; template using _CheckOptionalArgsCtor = _If< - _IsNotSame<__uncvref_t<_Up>, in_place_t>::value && - _IsNotSame<__uncvref_t<_Up>, optional>::value, + _IsNotSame<__remove_cvref_t<_Up>, in_place_t>::value && + _IsNotSame<__remove_cvref_t<_Up>, optional>::value, _CheckOptionalArgsConstructor, __check_tuple_constructor_fail >; @@ -825,9 +825,9 @@ template , optional>, + _IsNotSame<__remove_cvref_t<_Up>, optional>, _Or< - _IsNotSame<__uncvref_t<_Up>, value_type>, + _IsNotSame<__remove_cvref_t<_Up>, value_type>, _Not> >, is_constructible, diff --git a/libcxx/include/scoped_allocator b/libcxx/include/scoped_allocator --- a/libcxx/include/scoped_allocator +++ b/libcxx/include/scoped_allocator @@ -401,10 +401,10 @@ template struct __outermost<_Alloc, true> { - typedef typename remove_reference + typedef __libcpp_remove_reference_t < decltype(declval<_Alloc>().outer_allocator()) - >::type _OuterAlloc; + > _OuterAlloc; typedef typename __outermost<_OuterAlloc>::type type; _LIBCPP_INLINE_VISIBILITY type& operator()(_Alloc& __a) const _NOEXCEPT diff --git a/libcxx/include/thread b/libcxx/include/thread --- a/libcxx/include/thread +++ b/libcxx/include/thread @@ -231,7 +231,7 @@ thread() _NOEXCEPT : __t_(_LIBCPP_NULL_THREAD) {} #ifndef _LIBCPP_CXX03_LANG template , thread>::value> > + 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 @@ -300,7 +300,7 @@ template , __tuple_leaf>, + _IsNotSame<__remove_cvref_t<_Tp>, __tuple_leaf>, is_constructible<_Hp, _Tp> >::value > @@ -379,7 +379,7 @@ template , __tuple_leaf>, + _IsNotSame<__remove_cvref_t<_Tp>, __tuple_leaf>, is_constructible<_Hp, _Tp> >::value > @@ -666,7 +666,7 @@ // tuple(U&& ...) constructors (including allocator_arg_t variants) template struct _IsThisTuple : false_type { }; - template struct _IsThisTuple<_Up> : is_same<__uncvref_t<_Up>, tuple> { }; + template struct _IsThisTuple<_Up> : is_same<__remove_cvref_t<_Up>, tuple> { }; template struct _EnableUTypesCtor : _And< @@ -761,7 +761,7 @@ // tuple(const tuple&) constructors (including allocator_arg_t variants) - template , class = void> + template , class = void> struct _EnableCtorFromUTypesTuple : false_type {}; template @@ -913,7 +913,7 @@ // tuple(const pair&) constructors (including allocator_arg_t variants) - template