tmp/tmpi_z56pav/{from.md → to.md}
RENAMED
|
@@ -0,0 +1,45 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#### General <a id="istream.iterator.general">[[istream.iterator.general]]</a>
|
| 2 |
+
|
| 3 |
+
The class template `istream_iterator` is an input iterator
|
| 4 |
+
[[input.iterators]] that reads successive elements from the input stream
|
| 5 |
+
for which it was constructed.
|
| 6 |
+
|
| 7 |
+
``` cpp
|
| 8 |
+
namespace std {
|
| 9 |
+
template<class T, class charT = char, class traits = char_traits<charT>,
|
| 10 |
+
class Distance = ptrdiff_t>
|
| 11 |
+
class istream_iterator {
|
| 12 |
+
public:
|
| 13 |
+
using iterator_category = input_iterator_tag;
|
| 14 |
+
using value_type = T;
|
| 15 |
+
using difference_type = Distance;
|
| 16 |
+
using pointer = const T*;
|
| 17 |
+
using reference = const T&;
|
| 18 |
+
using char_type = charT;
|
| 19 |
+
using traits_type = traits;
|
| 20 |
+
using istream_type = basic_istream<charT,traits>;
|
| 21 |
+
|
| 22 |
+
constexpr istream_iterator();
|
| 23 |
+
constexpr istream_iterator(default_sentinel_t);
|
| 24 |
+
istream_iterator(istream_type& s);
|
| 25 |
+
constexpr istream_iterator(const istream_iterator& x) noexcept(see below);
|
| 26 |
+
~istream_iterator() = default;
|
| 27 |
+
istream_iterator& operator=(const istream_iterator&) = default;
|
| 28 |
+
|
| 29 |
+
const T& operator*() const;
|
| 30 |
+
const T* operator->() const;
|
| 31 |
+
istream_iterator& operator++();
|
| 32 |
+
istream_iterator operator++(int);
|
| 33 |
+
|
| 34 |
+
friend bool operator==(const istream_iterator& i, default_sentinel_t);
|
| 35 |
+
|
| 36 |
+
private:
|
| 37 |
+
basic_istream<charT,traits>* in_stream; // exposition only
|
| 38 |
+
T value; // exposition only
|
| 39 |
+
};
|
| 40 |
+
}
|
| 41 |
+
```
|
| 42 |
+
|
| 43 |
+
The type `T` shall meet the *Cpp17DefaultConstructible*,
|
| 44 |
+
*Cpp17CopyConstructible*, and *Cpp17CopyAssignable* requirements.
|
| 45 |
+
|