<html>
<head>
<base href="https://bugs.llvm.org/">
</head>
<body><table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Bug ID</th>
<td><a class="bz_bug_link
bz_status_NEW "
title="NEW - numeric algos copy 'init' but it only has to be move constructible, not copyable"
href="https://bugs.llvm.org/show_bug.cgi?id=42323">42323</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>numeric algos copy 'init' but it only has to be move constructible, not copyable
</td>
</tr>
<tr>
<th>Product</th>
<td>parallel STL
</td>
</tr>
<tr>
<th>Version</th>
<td>unspecified
</td>
</tr>
<tr>
<th>Hardware</th>
<td>All
</td>
</tr>
<tr>
<th>OS</th>
<td>All
</td>
</tr>
<tr>
<th>Status</th>
<td>NEW
</td>
</tr>
<tr>
<th>Severity</th>
<td>normal
</td>
</tr>
<tr>
<th>Priority</th>
<td>P
</td>
</tr>
<tr>
<th>Component</th>
<td>New
</td>
</tr>
<tr>
<th>Assignee</th>
<td>ldionne@apple.com
</td>
</tr>
<tr>
<th>Reporter</th>
<td>zilla@kayari.org
</td>
</tr>
<tr>
<th>CC</th>
<td>llvm-bugs@lists.llvm.org
</td>
</tr></table>
<p>
<div>
<pre>The "generalized numeric operations" defined in [numeric.ops] only require
Cpp17MoveConstructible for the T parameter, but PSTL copies it when passing it
from e.g. reduce to transform_reduce and then to __pattern_transform_reduce,
and then to __brick_transform_reduce and __brick_transform_scan.
Testcase:
#include <numeric>
#include <execution>
struct M {
M(int) { }
M(M&&) = default;
M& operator=(M&&) = default;
};
struct Bop
{
M operator()(M&, M&) { return M(0); }
};
int main()
{
M m(0);
std::reduce(std::execution::par, &m, &m, M{0}, Bop{});
}
The same problem exists for the other <numeric> algos too.</pre>
</div>
</p>
<hr>
<span>You are receiving this mail because:</span>
<ul>
<li>You are on the CC list for the bug.</li>
</ul>
</body>
</html>