Add policy check that excludes unsequenced policies

It's technically UB for the callable in an unsequenced policy to acquire a lock so we add static_assert()s to catch potential user error.
This commit is contained in:
Christian Mazakas
2023-05-01 11:58:58 -07:00
parent 615ce1e9b6
commit c52ad849ea
3 changed files with 17 additions and 4 deletions
+1 -1
View File
@@ -281,7 +281,7 @@ namespace {
thread_runner(values, [&num_invokes, &x, threshold](boost::span<T> s) {
(void)s;
x.erase_if(
std::execution::par_unseq, [&num_invokes, threshold](value_type& v) {
std::execution::par, [&num_invokes, threshold](value_type& v) {
++num_invokes;
return v.second.x_ > threshold;
});