+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()
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]
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>
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]
_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]
_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]