]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
Cleanup algorithm implementations
authorrodgertq <rodgertq@138bc75d-0d04-0410-961f-82ee72b054a4>
Sat, 20 Apr 2019 22:45:58 +0000 (22:45 +0000)
committerrodgertq <rodgertq@138bc75d-0d04-0410-961f-82ee72b054a4>
Sat, 20 Apr 2019 22:45:58 +0000 (22:45 +0000)
* 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.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@270471 138bc75d-0d04-0410-961f-82ee72b054a4

libstdc++-v3/ChangeLog
libstdc++-v3/include/pstl/glue_algorithm_impl.h

index ce726599d0e46781b46c066f0fe4f4566c7d2094..a2accc00415f396f3adf576d879789696e1287f4 100644 (file)
@@ -1,3 +1,13 @@
+2019-04-20  Thomas Rodgers <trodgers@redhat.com>
+
+       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 <trodgers@redhat.com>
        
        Improve implementation of parallel equal()
index db5ef2b76f5f2ef44bd9d9ad90f908ec0342685d..1c4a3511a48cc0598f387bc93594de9822400322 100644 (file)
@@ -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 <class _ExecutionPolicy, class _ForwardIterator1, class _ForwardIterator2>
@@ -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]