hpx::shift_left#

Defined in header hpx/algorithm.hpp.

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

namespace hpx

Functions

template<typename FwdIter, typename Size>
FwdIter shift_left(FwdIter first, FwdIter last, Size n)#

Shifts the elements in the range [first, last) by n positions towards the beginning of the range. For every integer i in [0, last - first

  • n), moves the element originally at position first + n + i to position first + i.

The assignment operations in the parallel shift_left algorithm invoked without an execution policy object will execute in sequential order in the calling thread.

Note

Complexity: At most (last - first) - n assignments.

Note

The type of dereferenced FwdIter must meet the requirements of MoveAssignable.

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

  • Size – The type of the argument specifying the number of positions to shift by.

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

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

  • n – Refers to the number of positions to shift.

Returns

The shift_left algorithm returns FwdIter. The shift_left algorithm returns an iterator to the end of the resulting range.

template<typename ExPolicy, typename FwdIter, typename Size>
hpx::parallel::util::detail::algorithm_result<ExPolicy, FwdIter> shift_left(ExPolicy &&policy, FwdIter first, FwdIter last, Size n)#

Shifts the elements in the range [first, last) by n positions towards the beginning of the range. For every integer i in [0, last - first

  • n), moves the element originally at position first + n + i to position first + i. Executed according to the policy.

The assignment operations in the parallel shift_left algorithm invoked with an execution policy object of type sequenced_policy execute in sequential order in the calling thread.

The assignment operations in the parallel shift_left algorithm invoked with an execution policy object of type parallel_policy or parallel_task_policy are permitted to execute in an unordered fashion in unspecified threads, and indeterminately sequenced within each thread.

Note

Complexity: At most (last - first) - n assignments.

Note

The type of dereferenced FwdIter must meet the requirements of MoveAssignable.

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.

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

  • Size – The type of the argument specifying the number of positions to shift by.

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.

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

  • n – Refers to the number of positions to shift.

Returns

The shift_left algorithm returns a hpx::future<FwdIter> if the execution policy is of type sequenced_task_policy or parallel_task_policy and returns FwdIter otherwise. The shift_left algorithm returns an iterator to the end of the resulting range.