template<class ForwardIterator, class T>
void fill(ForwardIterator first, ForwardIterator last, const T& value);
template<class ExecutionPolicy, class ForwardIterator, class T>
void fill(ExecutionPolicy&& exec,
ForwardIterator first, ForwardIterator last, const T& value);
template<class OutputIterator, class Size, class T>
OutputIterator fill_n(OutputIterator first, Size n, const T& value);
template<class ExecutionPolicy, class ForwardIterator, class Size, class T>
ForwardIterator fill_n(ExecutionPolicy&& exec,
ForwardIterator first, Size n, const T& value);
Effects:
The
fill algorithms assign
value through all the iterators in the range
[first, last). The
fill_n algorithms assign
value
through all the iterators in the range
[first, first + n)
if
n is positive, otherwise they do nothing
.Returns: fill_n returns
first + n for non-negative values of
n
and
first for negative values
. Complexity:
Exactly
last - first,
n, or 0 assignments, respectively
.