From 7611eb4869db50bd35e7bdac0cadccc5533e78a2 Mon Sep 17 00:00:00 2001 From: Louis Dionne Date: Tue, 7 Jun 2022 13:16:52 -0400 Subject: [PATCH] [libc++][NFC] Simplify enable_if for std::copy optimization Get rid of the __is_trivially_copy_assignable_unwrapped helper, which is only used in one place, and use __iter_value_type instead of iterator_traits::value_type. Differential Revision: https://reviews.llvm.org/D127230 --- libcxx/include/__algorithm/copy.h | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/libcxx/include/__algorithm/copy.h b/libcxx/include/__algorithm/copy.h index a09e03e..2a4e535 100644 --- a/libcxx/include/__algorithm/copy.h +++ b/libcxx/include/__algorithm/copy.h @@ -56,16 +56,11 @@ pair<_InValueT*, _OutValueT*> __copy_impl(_InValueT* __first, _InValueT* __last, return std::make_pair(__first + __n, __result + __n); } -template -using __is_trivially_copy_assignable_unwrapped = - _And<__is_cpp17_contiguous_iterator<_Iter>, is_trivially_copy_assignable<__iter_value_type<_Iter> > >; - -template ::value_type>::type, - typename iterator_traits<_OutIter>::value_type>::value - && __is_trivially_copy_assignable_unwrapped<_InIter>::value - && __is_trivially_copy_assignable_unwrapped<_OutIter>::value> > +template >::type, __iter_value_type<_OutIter> >::value + && __is_cpp17_contiguous_iterator<_InIter>::value + && __is_cpp17_contiguous_iterator<_OutIter>::value + && is_trivially_copy_assignable<__iter_value_type<_OutIter> >::value, int> = 0> inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX11 pair, reverse_iterator<_OutIter> > __copy_impl(reverse_iterator<_InIter> __first, -- 2.7.4