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:
All of
reduce
,transform_reduce
,exclusive_scan
, andinclusive_scan
,transform_exclusive_scan
, andtransform_inclusive_scan
only have a precondition on the type ofinit
that it meets the Cpp17MoveConstructible requirements, so when passing it to the next internal function it needs to be moved, not copied:And they need to move when creating local variables:
and when returning init as well:
https://github.com/oneapi-src/oneDPL/blame/b132b83cddec63df5b3794aba8c154cb186d568e/include/oneapi/dpl/pstl/numeric_impl.h#L176-L182