Daily bit(e) of C++ | std::iota, std::views::iota
Daily bit(e) of C++ ♻️55, Generating a sequence of consecutive values using std::iota and std::views::iota.
The std::iota is a simple algorithm that generates consecutive values by repeatedly applying the prefix increment, starting from the initial value.
While the base std::iota algorithm is fairly niche, the C++20 lazily evaluated std::views::iota is a more helpful version, particularly when combined with other views.