<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/118539>118539</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
PSTL algos in <numeric> need to move the __init variables
</td>
</tr>
<tr>
<th>Labels</th>
<td>
new issue
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
jwakely
</td>
</tr>
</table>
<pre>
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:
```diff
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));
```
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJyUU82O4ywQfBp8QRPZEDvOwYdMvsnpW2mk3TvC0I6ZxeCFJj9vv8JJZrS_0kpIbtzdVV2lRsZojg6gI_Uzqf8rZMLRh-7tLL-CvRa919duZy31AyVNGUAnBaQpCdvnOwbp4uDDJH7OwEXZFM0JRFTS3f9Lp3POuN_kfkD7W_dH1S841Dt7paM8AZV0DqC80waNd9Q7iiNQvM5wl2KcwdyCo0RqkE4AGJcisZ_navPJn2DvXcSQFJregqABviUTYAKHMQ8UPT2P4OicTXTHjIJ-gXBwQWocQnDS0iE5tUxhkDoAHXNZD3TyJ9AZyHmkys8GNOE7Ui6nKW9Hm2Eg5Y4GwBQc_aN61kZc2vlu8OEsgyZ8L14uoFLmfvXWqCvhL4S1QsAFFGHbzC3EYELEW2jlIwoQk73HvXEyXIWfCduTcvdEhZgj2huZEA-dj7vzS2n7TrBYzbaEP2dh7Pnf-t9lZbuW6R9475APrwrdcb3lW1lAV204Z_Wmqeti7LRu2qFVLd9sB64aqeVGVtVa8qoFDXJbmI6VbF2xkrOSbXi90o0amNJ8qGrZaNmSdQmTNHZl7Wla-XAsTIwJuqpqa74trOzBxuURMebgTJcsYSy_qdDlpqc-HSNZl9ZEjB8waNBC9_r5y_9U2qOP1DhK-N6lCYJRhL8sK5M3Juu_LejiAD3JYGRvIRYp2G5EnGM2ih0IOxwNjqlfKT8Rdshc98_THPwbKCTssEwYCTvcJZw69j0AAP__jcRRsA">