PicoBlog

Daily bit(e) of C++ | std::iota, 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.

Leave a comment

ncG1vNJzZmirmaK8r8DOrZ9nq6WXwLWtwqRlnKedZL1wsMCio7Jlkp7BpnnOn2ScZaOpsaq705pkrKyUq7amw9Kipq2Z

Delta Gatti

Update: 2024-12-04