hpx::ranges::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
namespace ranges

Functions

template<typename FwdIter, typename Sent, typename Size>
FwdIter shift_left(FwdIter first, Sent 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 an forward iterator.

  • Sent – The type of the source sentinel (deduced). This sentinel type must be a sentinel for FwdIter.

  • 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 sentinel value denoting the end of the sequence of elements the algorithm will be applied.

  • 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 Sent, typename Size>
hpx::parallel::util::detail::algorithm_result_t<ExPolicy, FwdIter> shift_left(ExPolicy &&policy, FwdIter first, Sent 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 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 an forward iterator.

  • Sent – The type of the source sentinel (deduced). This sentinel type must be a sentinel for FwdIter.

  • 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 sentinel value denoting the end of the sequence of elements the algorithm will be applied.

  • 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.

template<typename Rng, typename Size>
hpx::traits::range_iterator_t<Rng> shift_left(Rng &&rng, 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 hpx::traits::range_iterator_t<Rng> must meet the requirements of MoveAssignable.

Template Parameters
  • Rng – The type of the range used (deduced). The iterators extracted from this range type must meet the requirements of an forward iterator.

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

Parameters
  • rng – Refers to the range in which the elements will be shifted.

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

Returns

The shift_left algorithm returns hpx::traits::range_iterator_t<Rng>. The shift_left algorithm returns an iterator to the end of the resulting range.

template<typename ExPolicy, typename Rng, typename Size>
parallel::util::detail::algorithm_result<ExPolicy, hpx::traits::range_iterator_t<Rng>> shift_left(ExPolicy &&policy, Rng &&rng, 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 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 hpx::traits::range_iterator_t<Rng> 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.

  • Rng – The type of the range used (deduced). The iterators extracted from this range type must meet the requirements of an 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.

  • rng – Refers to the range in which the elements will be shifted.

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

Returns

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