Open
Description
All of reduce
, transform_reduce
, exclusive_scan
, and inclusive_scan
, transform_exclusive_scan
, and transform_inclusive_scan
only have a precondition on the type of init
that it meets the Cpp17MoveConstructible requirements, so when passing it to the next internal function it needs to be moved, not copied:
return transform_inclusive_scan(std::forward<_ExecutionPolicy>(__exec), __first, __last, __result, __binary_op,
- __pstl::__internal::__no_op(), __init);
+ __pstl::__internal::__no_op(), std::move(__init));
And they need to move when creating local variables:
- _Tp __temp = *__first;
+ _Tp __temp = std::move(*__first);
and when returning init as well:
- return std::make_pair(__result, __init);
+ return std::make_pair(__result, std::move(__init));
Metadata
Metadata
Assignees
Labels
No labels