hpx::rotate_copy

hpx::rotate_copy#

Defined in header hpx/algorithm.hpp.

See Public API for a list of names and headers that are part of the public HPX API.

See also:

template<typename FwdIter, typename OutIter>
OutIter hpx::rotate_copy(FwdIter first, FwdIter new_first, FwdIter last, OutIter dest_first)#

Copies the elements from the range [first, last), to another range beginning at dest_first in such a way, that the element new_first becomes the first element of the new range and new_first - 1 becomes the last element.

The assignments in the parallel rotate_copy algorithm execute in sequential order in the calling thread.

Note

Complexity: Performs exactly last - first assignments.

Template Parameters:
  • FwdIter – The type of the source iterators used (deduced). This iterator type must meet the requirements of a forward iterator.

  • OutIter – The type of the source iterators used (deduced). This iterator type must meet the requirements of a output iterator.

Parameters:
  • first – Refers to the beginning of the sequence of elements the algorithm will be applied to.

  • new_first – Refers to the element that should appear at the beginning of the rotated range.

  • last – Refers to the end of the sequence of elements the algorithm will be applied to.

  • dest_first – Refers to the begin of the destination range.

Returns:

The rotate_copy algorithm returns a output iterator, The rotate_copy algorithm returns the output iterator to the element past the last element copied.

template<typename ExPolicy, typename FwdIter1, typename FwdIter2>
hpx::parallel::util::detail::algorithm_result_t<ExPolicy, FwdIter2> hpx::rotate_copy(ExPolicy &&policy, FwdIter1 first, FwdIter1 new_first, FwdIter1 last, FwdIter2 dest_first)#

Copies the elements from the range [first, last), to another range beginning at dest_first in such a way, that the element new_first becomes the first element of the new range and new_first - 1 becomes the last element. Executed according to the policy.

The assignments in the parallel rotate_copy algorithm execute in sequential order in the calling thread.

The assignments in the parallel rotate_copy algorithm execute in an unordered fashion in unspecified threads, and indeterminately sequenced within each thread.

Note

Complexity: Performs exactly last - first assignments.

Template Parameters:
  • ExPolicy – The type of the execution policy to use (deduced). It describes the manner in which the execution of the algorithm may be parallelized and the manner in which it executes the assignments.

  • FwdIter1 – The type of the source iterators used (deduced). This iterator type must meet the requirements of a forward iterator.

  • FwdIter2 – The type of the iterator representing the destination range (deduced). This iterator type must meet the requirements of a forward iterator.

Parameters:
  • policy – The execution policy to use for the scheduling of the iterations.

  • first – Refers to the beginning of the sequence of elements the algorithm will be applied to.

  • new_first – Refers to the element that should appear at the beginning of the rotated range.

  • last – Refers to the end of the sequence of elements the algorithm will be applied to.

  • dest_first – Refers to the begin of the destination range.

Returns:

The rotate_copy algorithm returns a hpx::future<FwdIter2> if the execution policy is of type parallel_task_policy and returns FwdIter2 otherwise. The rotate_copy algorithm returns the output iterator to the element past the last element copied.