std::iota
From cppreference.com
Defined in header <numeric>
|
||
template< class ForwardIt, class T > void iota( ForwardIt first, ForwardIt last, T value ); |
(since C++11) (constexpr since C++20) |
|
Fills the range [
first,
last)
with sequentially increasing values, starting with value and repetitively evaluating ++value.
Equivalent operation (assuming ++value returns the incremented value):
*first = value; *++first = ++value; *++first = ++value; *++first = ++value; // repeats until “last” is reached
If any of the following conditions is satisfied, the program is ill-formed:
-
T
is not convertible to the value type ofForwardIt
. - The expression ++val is ill-formed, where val is a variable of type
T
.
Contents |