a view consisting of a sequence generated by repeatedly incrementing an initial value
More...
A range factory that generates a sequence of elements by repeatedly incrementing an initial value. Can be either bounded or unbounded (infinite).
Example
#include <algorithm>
#include <iostream>
#include <ranges>
struct Bound {
int bound;
bool operator==(
int x)
const {
return x == bound; }
bool operator!=(
int x)
const {
return x != bound; }
friend constexpr
bool operator==(
int x, Bound b) {
return x == b.bound;}
friend constexpr
bool operator!=(
int x, Bound b) {
return x != b.bound;}
};
int main()
{
for (int i : std::ranges::iota_view<int, int>{1, 10})
std::cout << i << ' ';
std::cout << '\n';
std::cout << i << ' ';
std::cout << '\n';
std::cout << i << ' ';
std::cout << '\n';
std::cout << i << ' ';
std::cout << '\n';
{
std::cout << i << ' ';
});
std::cout << '\n';
}
constexpr VCCC_INLINE_OR_STATIC detail::for_each_niebloid for_each
Definition: for_each.hpp:54
constexpr VCCC_INLINE_OR_STATIC detail::iota_niebloid iota
Definition: iota_view.hpp:539
constexpr VCCC_INLINE_OR_STATIC detail::take_niebloid take
Definition: take.hpp:177
constexpr bool operator!=(const MatrixBase< E1 > &lhs, const MatrixBase< E2 > &rhs)
Definition: mat_expr_operations.hpp:23
constexpr bool operator==(const MatrixBase< E1 > &lhs, const MatrixBase< E2 > &rhs)
Definition: mat_expr_operations.hpp:15
- See also
- std::ranges::iota_view
◆ iota
views::iota(e)
and views::iota(e, f)
are expression-equivalent to iota_view(e)
and iota_view(e, f)
respectively for any suitable subexpressions e
and f