HPX - High Performance ParalleX

PrevUpHomeNext

Function template copy_n

hpx::parallel::v1::copy_n

Synopsis

// In header: <hpx/parallel/detail/copy.hpp>


template<typename ExPolicy, typename InIter, typename Size, typename OutIter> 
  unspecified copy_n(ExPolicy && policy, InIter first, Size count, 
                     OutIter dest);

Description

Copies the elements in the range [first, first + count), starting from first and proceeding to first + count - 1., to another range beginning at dest.

[Note] Note

Complexity: Performs exactly count assignments, if count > 0, no assignments otherwise.

The assignments in the parallel copy_n algorithm invoked with an execution policy object of type sequential_execution_policy execute in sequential order in the calling thread.

The assignments in the parallel copy_n algorithm invoked with an execution policy object of type parallel_execution_policy or task_execution_policy are permitted to execute in an unordered fashion in unspecified threads, and indeterminately sequenced within each thread.

Parameters:

count

Refers to the number of elements starting at first the algorithm will be applied to.

dest

Refers to the beginning of the destination range.

first

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

policy

The execution policy to use for the scheduling of the iterations.

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.

InIter

The type of the source iterators used (deduced). This iterator type must meet the requirements of an input iterator.

OutIter

The type of the iterator representing the destination range (deduced). This iterator type must meet the requirements of an output iterator.

Size

The type of the argument specifying the number of elements to apply f to.

Returns:

The copy_n algorithm returns a hpx::future<OutIter> if the execution policy is of type task_execution_policy and returns OutIter otherwise. The copy_n algorithm returns the output iterator to the element in the destination range, one past the last element copied.


PrevUpHomeNext