Files
2025-10-25 03:02:53 +03:00

46 lines
1.7 KiB
Markdown
Raw Permalink Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

[range.iota.overview]
# 25 Ranges library [[ranges]](./#ranges)
## 25.6 Range factories [[range.factories]](range.factories#range.iota.overview)
### 25.6.4 Iota view [[range.iota]](range.iota#overview)
#### 25.6.4.1 Overview [range.iota.overview]
[1](#1)
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/ranges.tex#L2778)
iota_view generates a
sequence of elements by repeatedly incrementing an initial value[.](#1.sentence-1)
[2](#2)
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/ranges.tex#L2782)
The name views::iota denotes a
customization point object ([[customization.point.object]](customization.point.object "16.3.3.3.5Customization Point Object types"))[.](#2.sentence-1)
Given subexpressions E and F, the expressionsviews::iota(E) and views::iota(E, F) are expression-equivalent toiota_view<decay_t<decltype((E))>>(E) and iota_view(E, F),
respectively[.](#2.sentence-2)
[3](#3)
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/ranges.tex#L2792)
[*Example [1](#example-1)*: for (int i : views::iota(1, 10)) cout << i << ' '; // prints 1 2 3 4 5 6 7 8 9 — *end example*]
[4](#4)
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/ranges.tex#L2800)
The name views::indices denotes a
customization point object ([[customization.point.object]](customization.point.object "16.3.3.3.5Customization Point Object types"))[.](#4.sentence-1)
Given subexpression E,
let T be remove_cvref_t<decltype((E))>[.](#4.sentence-2)
views::indices(E) is expression-equivalent toviews::iota(T(0), E) if *is-integer-like*<T> is true,
and ill-formed otherwise[.](#4.sentence-3)