HPX - High Performance ParalleX

PrevUpHomeNext

Function template fill_n

hpx::parallel::v1::fill_n

Synopsis

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


template<typename ExPolicy, typename OutIter, typename Size, typename T> 
  unspecified fill_n(ExPolicy && policy, OutIter first, Size count, T value);

Description

Assigns the given value value to the first count elements in the range beginning at first if count > 0. Does nothing otherwise.

[Note] Note

Complexity: Performs exactly count assignments, for count > 0.

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

The comparisons in the parallel fill_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.

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.

value

The value to be assigned.

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.

OutIter

The type of the source iterators used (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.

T

The type of the value to be assigned (deduced).

Returns:

The fill_n algorithm returns a hpx::future<void> if the execution policy is of type task_execution_policy and returns difference_type otherwise (where difference_type is defined by void.


PrevUpHomeNext