transform#

Interface#

MP#

void dr::mp::transform(rng::forward_range auto &&in, dr::distributed_iterator auto out, auto op)#
template<rng::forward_iterator DI_IN>
void dr::mp::transform(DI_IN &&first, DI_IN &&last, dr::distributed_iterator auto &&out, auto op)#

SP#

template<class ExecutionPolicy>
auto dr::sp::transform(ExecutionPolicy &&policy, dr::distributed_range auto &&in, dr::distributed_iterator auto out, auto &&fn)#

Applies the given function to a range and stores the result in another range, beginning at out.

Parameters:
  • policy – use dr::sp::par_unseq here only

  • in – the range of elements to transform

  • out – the beginning of the destination range, may be equal to the beginning of in range

  • fn – operation to apply to input elements

Returns:

an unary_transform_result containing an input iterator equal to the end of in range and an output iterator to the element past the last element transformed

template<dr::distributed_range R, dr::distributed_iterator Iter, typename Fn>
auto dr::sp::transform(R &&in, Iter out, Fn &&fn)#
template<typename ExecutionPolicy, dr::distributed_iterator Iter1, dr::distributed_iterator Iter2, typename Fn>
auto dr::sp::transform(ExecutionPolicy &&policy, Iter1 in_begin, Iter1 in_end, Iter2 out_end, Fn &&fn)#
template<dr::distributed_iterator Iter1, dr::distributed_iterator Iter2, typename Fn>
auto dr::sp::transform(Iter1 in_begin, Iter1 in_end, Iter2 out_end, Fn &&fn)#

Description#

See also

std::transform

C++ model

std::ranges::transform

C++ range-based model

reduce

related algorithm

Usage#