From Jason Turner

[range.istream.iterator]

Diff to HTML by rtfpessoa

Files changed (1) hide show
  1. tmp/tmp2m_07m5d/{from.md → to.md} +6 -14
tmp/tmp2m_07m5d/{from.md → to.md} RENAMED
@@ -1,19 +1,18 @@
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
 
@@ -26,11 +25,11 @@ namespace std::ranges {
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
@@ -41,37 +40,30 @@ constexpr explicit iterator(basic_istream_view& parent) noexcept;
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
 
 
1
+ #### Class `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 {
9
  public:
10
  using iterator_concept = input_iterator_tag;
11
  using difference_type = ptrdiff_t;
12
  using value_type = Val;
13
 
 
14
  constexpr explicit iterator(basic_istream_view& parent) noexcept;
15
 
16
  iterator(const iterator&) = delete;
17
  iterator(iterator&&) = default;
18
 
 
25
  Val& operator*() const;
26
 
27
  friend bool operator==(const iterator& x, default_sentinel_t);
28
 
29
  private:
30
+ basic_istream_view* parent_; // exposition only
31
  };
32
  }
33
  ```
34
 
35
  ``` cpp
 
40
 
41
  ``` cpp
42
  iterator& operator++();
43
  ```
44
 
 
 
45
  *Effects:* Equivalent to:
46
 
47
  ``` cpp
48
+ *parent_->stream_ >> parent_->value_;
49
  return *this;
50
  ```
51
 
52
  ``` cpp
53
  void operator++(int);
54
  ```
55
 
 
 
56
  *Effects:* Equivalent to `++*this`.
57
 
58
  ``` cpp
59
  Val& operator*() const;
60
  ```
61
 
62
+ *Effects:* Equivalent to: `return `*`parent_`*`->`*`value_`*`;`
 
 
63
 
64
  ``` cpp
65
  friend bool operator==(const iterator& x, default_sentinel_t);
66
  ```
67
 
68
+ *Effects:* Equivalent to: `return !*x.`*`parent_`*`->`*`stream_`*`;`
 
69