fill_n |
Set n items to a particular value.
Assign value
to the n elements starting at position first
. Return an iterator equal to result +
n .
#include <algorithm>
template< class OutputIterator, class Size, class T >
void fill_n( OutputIterator first, Size n, const T& value );
Time complexity is linear as exactly n assignments are performed. Space complexity is constant.
Copyright©1994-2026 Recursion Software LLC
All Rights Reserved - For use by licensed users only.