FillMonotonicSeq< T > Struct Template Reference#
ck::utils::FillMonotonicSeq< T > Struct Template Reference
A functor for filling a container with a monotonically increasing or decreasing sequence. More...
#include <fill.hpp>
Public Member Functions | |
| template<typename ForwardIter> | |
| void | operator() (ForwardIter first, ForwardIter last) const |
| template<typename ForwardRange> | |
| auto | operator() (ForwardRange &&range) const -> std::void_t< decltype(std::declval< const FillMonotonicSeq & >()(std::begin(std::forward< ForwardRange >(range)), std::end(std::forward< ForwardRange >(range))))> |
Public Attributes | |
| T | init_value_ {0} |
| T | step_ {1} |
Detailed Description
template<typename T>
struct ck::utils::FillMonotonicSeq< T >
struct ck::utils::FillMonotonicSeq< T >
A functor for filling a container with a monotonically increasing or decreasing sequence.
FillMonotonicSeq generates a sequence of values starting from an initial value and incrementing by a fixed step for each subsequent element.
- Template Parameters
-
T The numeric type of the sequence elements.
Example usage:
std::vector<int> v(5);
FillMonotonicSeq<int>{10, 2}(v); // Fills v with {10, 12, 14, 16, 18}
A functor for filling a container with a monotonically increasing or decreasing sequence.
Definition library/utility/fill.hpp:104
Member Function Documentation
◆ operator()() [1/2]
template<typename T>
template<typename ForwardIter>
|
inline |
◆ operator()() [2/2]
template<typename T>
template<typename ForwardRange>
|
inline |
Member Data Documentation
◆ init_value_
template<typename T>
| T ck::utils::FillMonotonicSeq< T >::init_value_ {0} |
◆ step_
template<typename T>
| T ck::utils::FillMonotonicSeq< T >::step_ {1} |
The documentation for this struct was generated from the following file: