From e71b181eed2f5c82aecaf89f44e9f096d18540f5 Mon Sep 17 00:00:00 2001 From: MikeDvorskiy <40659946+MikeDvorskiy@users.noreply.github.com> Date: Wed, 10 Feb 2021 20:14:07 +0300 Subject: [pstl] + a hot fix for an identity value for __pattern_minmax_element --- include/oneapi/dpl/pstl/algorithm_impl.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/oneapi/dpl/pstl/algorithm_impl.h b/include/oneapi/dpl/pstl/algorithm_impl.h index 76b77e59991d..24ddc31d57ea 100644 --- a/include/oneapi/dpl/pstl/algorithm_impl.h +++ b/include/oneapi/dpl/pstl/algorithm_impl.h @@ -3786,7 +3786,7 @@ __pattern_minmax_element(_ExecutionPolicy&& __exec, _ForwardIterator __first, _F return __par_backend::__parallel_reduce( ::std::forward<_ExecutionPolicy>(__exec), __first, __last, - /*identity*/ ::std::make_pair(__last, __first - 1), + /*identity*/ ::std::make_pair(__last, __last), [=, &__comp](_ForwardIterator __begin, _ForwardIterator __end, _Result __init) -> _Result { const _Result __subresult = __internal::__brick_minmax_element(__begin, __end, __comp, __is_vector); if (__init.first == __last) // = identity -- cgit v1.2.3-65-gdbad