From: Thomas Rodgers Date: Sat, 20 Apr 2019 22:45:58 +0000 (+0000) Subject: Cleanup algorithm implementations X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=9762ea561df659c21f8d61d52561c5977dc72521;p=gcc.git Cleanup algorithm implementations * include/pstl/glue_algorithm_impl.h (stable_sort): Forward execution policy. (mismatch): Forward execution policy. (equal): Qualify call to std::equal(). (partial_sort): Forward execution policy. (inplace_merge): Forward execution policy. From-SVN: r270471 --- diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog index ce726599d0e..a2accc00415 100644 --- a/libstdc++-v3/ChangeLog +++ b/libstdc++-v3/ChangeLog @@ -1,3 +1,13 @@ +2019-04-20 Thomas Rodgers + + Cleanup algorithm implementations + * include/pstl/glue_algorithm_impl.h (stable_sort): Forward + execution policy. + (mismatch): Forward execution policy. + (equal): Qualify call to std::equal(). + (partial_sort): Forward execution policy. + (inplace_merge): Forward execution policy. + 2019-04-19 Thomas Rodgers Improve implementation of parallel equal() diff --git a/libstdc++-v3/include/pstl/glue_algorithm_impl.h b/libstdc++-v3/include/pstl/glue_algorithm_impl.h index db5ef2b76f5..1c4a3511a48 100644 --- a/libstdc++-v3/include/pstl/glue_algorithm_impl.h +++ b/libstdc++-v3/include/pstl/glue_algorithm_impl.h @@ -674,7 +674,7 @@ __pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, void> stable_sort(_ExecutionPolicy&& __exec, _RandomAccessIterator __first, _RandomAccessIterator __last) { typedef typename std::iterator_traits<_RandomAccessIterator>::value_type _InputType; - std::stable_sort(__exec, __first, __last, std::less<_InputType>()); + std::stable_sort(std::forward<_ExecutionPolicy>(__exec), __first, __last, std::less<_InputType>()); } // [mismatch] @@ -696,8 +696,8 @@ __pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, std::pair<_Fo mismatch(_ExecutionPolicy&& __exec, _ForwardIterator1 __first1, _ForwardIterator1 __last1, _ForwardIterator2 __first2, _BinaryPredicate __pred) { - return std::mismatch(__exec, __first1, __last1, __first2, std::next(__first2, std::distance(__first1, __last1)), - __pred); + return std::mismatch(std::forward<_ExecutionPolicy>(__exec), __first1, __last1, __first2, + std::next(__first2, std::distance(__first1, __last1)), __pred); } template @@ -757,8 +757,8 @@ __pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, bool> equal(_ExecutionPolicy&& __exec, _ForwardIterator1 __first1, _ForwardIterator1 __last1, _ForwardIterator2 __first2, _ForwardIterator2 __last2) { - return equal(std::forward<_ExecutionPolicy>(__exec), __first1, __last1, __first2, __last2, - __pstl::__internal::__pstl_equal()); + return std::equal(std::forward<_ExecutionPolicy>(__exec), __first1, __last1, __first2, __last2, + __pstl::__internal::__pstl_equal()); } // [alg.move] @@ -798,7 +798,7 @@ partial_sort(_ExecutionPolicy&& __exec, _RandomAccessIterator __first, _RandomAc _RandomAccessIterator __last) { typedef typename iterator_traits<_RandomAccessIterator>::value_type _InputType; - std::partial_sort(__exec, __first, __middle, __last, std::less<_InputType>()); + std::partial_sort(std::forward<_ExecutionPolicy>(__exec), __first, __middle, __last, std::less<_InputType>()); } // [partial.sort.copy] @@ -908,7 +908,7 @@ inplace_merge(_ExecutionPolicy&& __exec, _BidirectionalIterator __first, _Bidire _BidirectionalIterator __last) { typedef typename std::iterator_traits<_BidirectionalIterator>::value_type _InputType; - std::inplace_merge(__exec, __first, __middle, __last, std::less<_InputType>()); + std::inplace_merge(std::forward<_ExecutionPolicy>(__exec), __first, __middle, __last, std::less<_InputType>()); } // [includes]