From Jason Turner

[range.istream.iterator]

Diff to HTML by rtfpessoa

Files changed (1) hide show
  1. tmp/tmpz5obdiyn/{from.md → to.md} +77 -0
tmp/tmpz5obdiyn/{from.md → to.md} RENAMED
@@ -0,0 +1,77 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #### Class template `basic_istream_view::iterator` <a id="range.istream.iterator">[[range.istream.iterator]]</a>
2
+
3
+ ``` cpp
4
+ namespace std::ranges {
5
+ template<movable Val, class CharT, class Traits>
6
+ requires default_initializable<Val> &&
7
+ stream-extractable<Val, CharT, Traits>
8
+ class basic_istream_view<Val, CharT, Traits>::iterator { // exposition only
9
+ public:
10
+ using iterator_concept = input_iterator_tag;
11
+ using difference_type = ptrdiff_t;
12
+ using value_type = Val;
13
+
14
+ iterator() = default;
15
+ constexpr explicit iterator(basic_istream_view& parent) noexcept;
16
+
17
+ iterator(const iterator&) = delete;
18
+ iterator(iterator&&) = default;
19
+
20
+ iterator& operator=(const iterator&) = delete;
21
+ iterator& operator=(iterator&&) = default;
22
+
23
+ iterator& operator++();
24
+ void operator++(int);
25
+
26
+ Val& operator*() const;
27
+
28
+ friend bool operator==(const iterator& x, default_sentinel_t);
29
+
30
+ private:
31
+ basic_istream_view* parent_ = nullptr; // exposition only
32
+ };
33
+ }
34
+ ```
35
+
36
+ ``` cpp
37
+ constexpr explicit iterator(basic_istream_view& parent) noexcept;
38
+ ```
39
+
40
+ *Effects:* Initializes *parent\_* with `addressof(parent)`.
41
+
42
+ ``` cpp
43
+ iterator& operator++();
44
+ ```
45
+
46
+ *Preconditions:* *`parent_`*`->`*`stream_`*` != nullptr` is `true`.
47
+
48
+ *Effects:* Equivalent to:
49
+
50
+ ``` cpp
51
+ *parent_->stream_>> parent_->object_;
52
+ return *this;
53
+ ```
54
+
55
+ ``` cpp
56
+ void operator++(int);
57
+ ```
58
+
59
+ *Preconditions:* *`parent_`*`->`*`stream_`*` != nullptr` is `true`.
60
+
61
+ *Effects:* Equivalent to `++*this`.
62
+
63
+ ``` cpp
64
+ Val& operator*() const;
65
+ ```
66
+
67
+ *Preconditions:* *`parent_`*`->`*`stream_`*` != nullptr` is `true`.
68
+
69
+ *Effects:* Equivalent to: `return `*`parent_`*`->`*`object_`*`;`
70
+
71
+ ``` cpp
72
+ friend bool operator==(const iterator& x, default_sentinel_t);
73
+ ```
74
+
75
+ *Effects:* Equivalent to:
76
+ `return x.`*`parent_`*` == nullptr || !*x.`*`parent_`*`->`*`stream_`*`;`
77
+