From Jason Turner

[istream.iterator.ops]

Diff to HTML by rtfpessoa

Files changed (1) hide show
  1. tmp/tmpbfu2elh8/{from.md → to.md} +19 -12
tmp/tmpbfu2elh8/{from.md → to.md} RENAMED
@@ -1,41 +1,50 @@
1
- #### `istream_iterator` operations <a id="istream.iterator.ops">[[istream.iterator.ops]]</a>
2
 
3
  ``` cpp
4
  const T& operator*() const;
5
  ```
6
 
 
 
7
  *Returns:* `value`.
8
 
9
  ``` cpp
10
  const T* operator->() const;
11
  ```
12
 
13
- *Returns:* `addressof(operator*())`.
 
 
14
 
15
  ``` cpp
16
  istream_iterator& operator++();
17
  ```
18
 
19
- *Requires:* `in_stream != 0`.
20
 
21
- *Effects:* As if by: `*in_stream >> value;`
 
 
 
 
 
22
 
23
  *Returns:* `*this`.
24
 
25
  ``` cpp
26
  istream_iterator operator++(int);
27
  ```
28
 
29
- *Requires:* `in_stream != 0`.
30
 
31
- *Effects:* As if by:
32
 
33
  ``` cpp
34
  istream_iterator tmp = *this;
35
- *in_stream >> value;
36
- return (tmp);
37
  ```
38
 
39
  ``` cpp
40
  template<class T, class charT, class traits, class Distance>
41
  bool operator==(const istream_iterator<T,charT,traits,Distance>& x,
@@ -43,12 +52,10 @@ template <class T, class charT, class traits, class Distance>
43
  ```
44
 
45
  *Returns:* `x.in_stream == y.in_stream`.
46
 
47
  ``` cpp
48
- template <class T, class charT, class traits, class Distance>
49
- bool operator!=(const istream_iterator<T,charT,traits,Distance>& x,
50
- const istream_iterator<T,charT,traits,Distance>& y);
51
  ```
52
 
53
- *Returns:* `!(x == y)`
54
 
 
1
+ #### Operations <a id="istream.iterator.ops">[[istream.iterator.ops]]</a>
2
 
3
  ``` cpp
4
  const T& operator*() const;
5
  ```
6
 
7
+ *Preconditions:* `in_stream != nullptr` is `true`.
8
+
9
  *Returns:* `value`.
10
 
11
  ``` cpp
12
  const T* operator->() const;
13
  ```
14
 
15
+ *Preconditions:* `in_stream != nullptr` is `true`.
16
+
17
+ *Returns:* `addressof(value)`.
18
 
19
  ``` cpp
20
  istream_iterator& operator++();
21
  ```
22
 
23
+ *Preconditions:* `in_stream != nullptr` is `true`.
24
 
25
+ *Effects:* Equivalent to:
26
+
27
+ ``` cpp
28
+ if (!(*in_stream >> value))
29
+ in_stream = nullptr;
30
+ ```
31
 
32
  *Returns:* `*this`.
33
 
34
  ``` cpp
35
  istream_iterator operator++(int);
36
  ```
37
 
38
+ *Preconditions:* `in_stream != nullptr` is `true`.
39
 
40
+ *Effects:* Equivalent to:
41
 
42
  ``` cpp
43
  istream_iterator tmp = *this;
44
+ ++*this;
45
+ return tmp;
46
  ```
47
 
48
  ``` cpp
49
  template<class T, class charT, class traits, class Distance>
50
  bool operator==(const istream_iterator<T,charT,traits,Distance>& x,
 
52
  ```
53
 
54
  *Returns:* `x.in_stream == y.in_stream`.
55
 
56
  ``` cpp
57
+ friend bool operator==(const istream_iterator& i, default_sentinel_t);
 
 
58
  ```
59
 
60
+ *Returns:* `!i.in_stream`.
61