You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've checked there is a function overloading with ExecutionPolicy parameters in std::for_each:
template< classExecutionPolicy, classForwardIt, classUnaryFunction2 >
voidfor_each( ExecutionPolicy&& policy, ForwardIt first, ForwardIt last, UnaryFunction2 f );
I think that the execution policy parameters can also be added into std::ranges::for_each function and the
following overloading structure can be considered.
template< classExecutionPolicy, std::input_iterator I,
std::sentinel_for<I> S, classProj = std::identity,
std::indirectly_unary_invocable<std::projected<I, Proj>> Fun >
requires (std::is_execution_policy_v<std::remove_cvref_t<ExecutionPolicy>>)
constexpr for_each_result<I, Fun>
for_each( ExecutionPolicy&& policy, I first, S last, Fun f, Proj proj = {} );
template< classExecutionPolicy, ranges::input_range R, classProj =std::identity,
std::indirectly_unary_invocable<std::projected<ranges::iterator_t<R>,
Proj>> Fun >
requires (std::is_execution_policy_v<std::remove_cvref_t<ExecutionPolicy>>)
constexpr for_each_result<ranges::borrowed_iterator_t<R>, Fun>
for_each( ExecutionPolicy&& policy, R&& r, Fun f, Proj proj = {} );
An advantage of this design is to integrate parallel algorithm into ranges::for_each function.
The text was updated successfully, but these errors were encountered:
The issue sounds like a proposal. Adding new overloads to ranges::for_each is not an editorial issue. I suggest you read the first section of the README for more information on what that might mean.
You need to submit a proposal. The issue process is for fixing defects. This is not a defect. The lack of parallel overloads for the ranges algo is intentional, not a mistake.
Hi,
I've checked there is a function overloading with ExecutionPolicy parameters in
std::for_each
:I think that the execution policy parameters can also be added into std::ranges::for_each function and the
following overloading structure can be considered.
An advantage of this design is to integrate parallel algorithm into ranges::for_each function.
The text was updated successfully, but these errors were encountered: