24 Algorithms library [algorithms]

24.6 Mutating sequence operations [alg.modifying.operations]

24.6.6 Fill [alg.fill]

template<class ForwardIterator, class T> constexpr 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> constexpr 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); namespace ranges { template<class T, OutputIterator<const T&> O, Sentinel<O> S> constexpr O fill(O first, S last, const T& value); template<class T, OutputRange<const T&> R> constexpr safe_iterator_t<R> fill(R&& r, const T& value); template<class T, OutputIterator<const T&> O> constexpr O fill_n(O first, iter_difference_t<O> n, const T& value); }
Let N be for the fill_­n algorithms, and last - first for the fill algorithms.
Requires: The expression value shall be writable ([iterator.requirements.general]) to the output iterator.
The type Size shall be convertible to an integral type ([conv.integral], [class.conv]).
Effects: Assigns value through all the iterators in the range [first, first + N).
Returns: first + N.
Complexity: Exactly N assignments.