fill_n

fill_n#

stdgpu: stdgpu::fill_n
stdgpu Latest
Efficient STL-like Data Structures on the GPU

◆ fill_n()

template<typename ExecutionPolicy , typename Iterator , typename Size , typename T , STDGPU_DETAIL_OVERLOAD_IF(is_execution_policy_v< remove_cvref_t< ExecutionPolicy > >) >
Iterator stdgpu::fill_n ( ExecutionPolicy &&  policy,
Iterator  begin,
Size  n,
const T &  value 
)

Writes the given value into the given range using the copy assignment operator.

Template Parameters
ExecutionPolicyThe type of the execution policy
IteratorThe type of the iterators
SizeThe size type
TThe type of the value
Parameters
[in]policyThe execution policy, e.g. host or device
[in]beginThe iterator pointing to the first element
[in]nThe number of elements in the value range
[in]valueThe value that will be written
Returns
The iterator pointing to the last element