tmp/tmpjdkyim_c/{from.md → to.md}
RENAMED
|
@@ -3,22 +3,22 @@
|
|
| 3 |
``` cpp
|
| 4 |
namespace std {
|
| 5 |
template<class charT, class traits = char_traits<charT>>
|
| 6 |
class basic_istream : virtual public basic_ios<charT, traits> {
|
| 7 |
public:
|
| 8 |
-
// types (inherited from basic_ios
|
| 9 |
using char_type = charT;
|
| 10 |
using int_type = typename traits::int_type;
|
| 11 |
using pos_type = typename traits::pos_type;
|
| 12 |
using off_type = typename traits::off_type;
|
| 13 |
using traits_type = traits;
|
| 14 |
|
| 15 |
// [istream.cons], constructor/destructor
|
| 16 |
explicit basic_istream(basic_streambuf<charT, traits>* sb);
|
| 17 |
virtual ~basic_istream();
|
| 18 |
|
| 19 |
-
// [istream
|
| 20 |
class sentry;
|
| 21 |
|
| 22 |
// [istream.formatted], formatted input
|
| 23 |
basic_istream<charT, traits>&
|
| 24 |
operator>>(basic_istream<charT, traits>& (*pf)(basic_istream<charT, traits>&));
|
|
@@ -68,15 +68,15 @@ namespace std {
|
|
| 68 |
basic_istream<charT, traits>& seekg(pos_type);
|
| 69 |
basic_istream<charT, traits>& seekg(off_type, ios_base::seekdir);
|
| 70 |
|
| 71 |
protected:
|
| 72 |
// [istream.cons], copy/move constructor
|
| 73 |
-
basic_istream(const basic_istream&
|
| 74 |
basic_istream(basic_istream&& rhs);
|
| 75 |
|
| 76 |
// [istream.assign], assign and swap
|
| 77 |
-
basic_istream& operator=(const basic_istream&
|
| 78 |
basic_istream& operator=(basic_istream&& rhs);
|
| 79 |
void swap(basic_istream& rhs);
|
| 80 |
};
|
| 81 |
|
| 82 |
// [istream.extractors], character extraction templates
|
|
@@ -85,16 +85,16 @@ namespace std {
|
|
| 85 |
template<class traits>
|
| 86 |
basic_istream<char, traits>& operator>>(basic_istream<char, traits>&, unsigned char&);
|
| 87 |
template<class traits>
|
| 88 |
basic_istream<char, traits>& operator>>(basic_istream<char, traits>&, signed char&);
|
| 89 |
|
| 90 |
-
template<class charT, class traits>
|
| 91 |
-
basic_istream<charT, traits>& operator>>(basic_istream<charT, traits>&, charT
|
| 92 |
-
template<class traits>
|
| 93 |
-
basic_istream<char, traits>& operator>>(basic_istream<char, traits>&, unsigned char
|
| 94 |
-
template<class traits>
|
| 95 |
-
basic_istream<char, traits>& operator>>(basic_istream<char, traits>&, signed char
|
| 96 |
}
|
| 97 |
```
|
| 98 |
|
| 99 |
The class template `basic_istream` defines a number of member function
|
| 100 |
signatures that assist in reading and interpreting input from sequences
|
|
@@ -107,72 +107,67 @@ obtain (or *extract*) input *characters* by calling `rdbuf()->sbumpc()`
|
|
| 107 |
or `rdbuf()->sgetc()`. They may use other public members of `istream`.
|
| 108 |
|
| 109 |
If `rdbuf()->sbumpc()` or `rdbuf()->sgetc()` returns `traits::eof()`,
|
| 110 |
then the input function, except as explicitly noted otherwise, completes
|
| 111 |
its actions and does `setstate(eofbit)`, which may throw
|
| 112 |
-
`ios_base::failure`
|
| 113 |
|
| 114 |
If one of these called functions throws an exception, then unless
|
| 115 |
-
explicitly noted otherwise, the input function sets `badbit` in
|
| 116 |
-
state. If `badbit` is
|
| 117 |
-
the exception without completing its actions, otherwise it does
|
| 118 |
-
throw anything and proceeds as if the called function had returned a
|
| 119 |
failure indication.
|
| 120 |
|
| 121 |
-
#####
|
| 122 |
|
| 123 |
``` cpp
|
| 124 |
explicit basic_istream(basic_streambuf<charT, traits>* sb);
|
| 125 |
```
|
| 126 |
|
| 127 |
-
*Effects:*
|
| 128 |
-
|
| 129 |
-
`basic_ios::init(sb)` ([[basic.ios.cons]]).
|
| 130 |
|
| 131 |
-
*
|
| 132 |
|
| 133 |
``` cpp
|
| 134 |
basic_istream(basic_istream&& rhs);
|
| 135 |
```
|
| 136 |
|
| 137 |
-
*Effects:*
|
| 138 |
-
|
| 139 |
-
|
| 140 |
-
base class, and setting the `gcount()` for `rhs` to 0.
|
| 141 |
|
| 142 |
``` cpp
|
| 143 |
virtual ~basic_istream();
|
| 144 |
```
|
| 145 |
|
| 146 |
-
*Effects:* Destroys an object of class `basic_istream`.
|
| 147 |
-
|
| 148 |
*Remarks:* Does not perform any operations of `rdbuf()`.
|
| 149 |
|
| 150 |
-
#####
|
| 151 |
|
| 152 |
``` cpp
|
| 153 |
basic_istream& operator=(basic_istream&& rhs);
|
| 154 |
```
|
| 155 |
|
| 156 |
-
*Effects:*
|
| 157 |
|
| 158 |
*Returns:* `*this`.
|
| 159 |
|
| 160 |
``` cpp
|
| 161 |
void swap(basic_istream& rhs);
|
| 162 |
```
|
| 163 |
|
| 164 |
*Effects:* Calls `basic_ios<charT, traits>::swap(rhs)`. Exchanges the
|
| 165 |
values returned by `gcount()` and `rhs.gcount()`.
|
| 166 |
|
| 167 |
-
##### Class `basic_istream::sentry` <a id="istream
|
| 168 |
|
| 169 |
``` cpp
|
| 170 |
namespace std {
|
| 171 |
template<class charT, class traits = char_traits<charT>>
|
| 172 |
class basic_istream<charT, traits>::sentry {
|
| 173 |
-
using traits_type = traits;
|
| 174 |
bool ok_; // exposition only
|
| 175 |
public:
|
| 176 |
explicit sentry(basic_istream<charT, traits>& is, bool noskipws = false);
|
| 177 |
~sentry();
|
| 178 |
explicit operator bool() const { return ok_; }
|
|
@@ -223,11 +218,11 @@ if (ctype.is(ctype.space, c) != 0)
|
|
| 223 |
```
|
| 224 |
|
| 225 |
If, after any preparation is completed, `is.good()` is `true`,
|
| 226 |
`ok_ != false` otherwise, `ok_ == false`. During preparation, the
|
| 227 |
constructor may call `setstate(failbit)` (which may throw
|
| 228 |
-
`ios_base::failure`
|
| 229 |
|
| 230 |
``` cpp
|
| 231 |
~sentry();
|
| 232 |
```
|
| 233 |
|
|
@@ -235,7 +230,7 @@ constructor may call `setstate(failbit)` (which may throw
|
|
| 235 |
|
| 236 |
``` cpp
|
| 237 |
explicit operator bool() const;
|
| 238 |
```
|
| 239 |
|
| 240 |
-
*
|
| 241 |
|
|
|
|
| 3 |
``` cpp
|
| 4 |
namespace std {
|
| 5 |
template<class charT, class traits = char_traits<charT>>
|
| 6 |
class basic_istream : virtual public basic_ios<charT, traits> {
|
| 7 |
public:
|
| 8 |
+
// types (inherited from basic_ios[ios])
|
| 9 |
using char_type = charT;
|
| 10 |
using int_type = typename traits::int_type;
|
| 11 |
using pos_type = typename traits::pos_type;
|
| 12 |
using off_type = typename traits::off_type;
|
| 13 |
using traits_type = traits;
|
| 14 |
|
| 15 |
// [istream.cons], constructor/destructor
|
| 16 |
explicit basic_istream(basic_streambuf<charT, traits>* sb);
|
| 17 |
virtual ~basic_istream();
|
| 18 |
|
| 19 |
+
// [istream.sentry], prefix/suffix
|
| 20 |
class sentry;
|
| 21 |
|
| 22 |
// [istream.formatted], formatted input
|
| 23 |
basic_istream<charT, traits>&
|
| 24 |
operator>>(basic_istream<charT, traits>& (*pf)(basic_istream<charT, traits>&));
|
|
|
|
| 68 |
basic_istream<charT, traits>& seekg(pos_type);
|
| 69 |
basic_istream<charT, traits>& seekg(off_type, ios_base::seekdir);
|
| 70 |
|
| 71 |
protected:
|
| 72 |
// [istream.cons], copy/move constructor
|
| 73 |
+
basic_istream(const basic_istream&) = delete;
|
| 74 |
basic_istream(basic_istream&& rhs);
|
| 75 |
|
| 76 |
// [istream.assign], assign and swap
|
| 77 |
+
basic_istream& operator=(const basic_istream&) = delete;
|
| 78 |
basic_istream& operator=(basic_istream&& rhs);
|
| 79 |
void swap(basic_istream& rhs);
|
| 80 |
};
|
| 81 |
|
| 82 |
// [istream.extractors], character extraction templates
|
|
|
|
| 85 |
template<class traits>
|
| 86 |
basic_istream<char, traits>& operator>>(basic_istream<char, traits>&, unsigned char&);
|
| 87 |
template<class traits>
|
| 88 |
basic_istream<char, traits>& operator>>(basic_istream<char, traits>&, signed char&);
|
| 89 |
|
| 90 |
+
template<class charT, class traits, size_t N>
|
| 91 |
+
basic_istream<charT, traits>& operator>>(basic_istream<charT, traits>&, charT(&)[N]);
|
| 92 |
+
template<class traits, size_t N>
|
| 93 |
+
basic_istream<char, traits>& operator>>(basic_istream<char, traits>&, unsigned char(&)[N]);
|
| 94 |
+
template<class traits, size_t N>
|
| 95 |
+
basic_istream<char, traits>& operator>>(basic_istream<char, traits>&, signed char(&)[N]);
|
| 96 |
}
|
| 97 |
```
|
| 98 |
|
| 99 |
The class template `basic_istream` defines a number of member function
|
| 100 |
signatures that assist in reading and interpreting input from sequences
|
|
|
|
| 107 |
or `rdbuf()->sgetc()`. They may use other public members of `istream`.
|
| 108 |
|
| 109 |
If `rdbuf()->sbumpc()` or `rdbuf()->sgetc()` returns `traits::eof()`,
|
| 110 |
then the input function, except as explicitly noted otherwise, completes
|
| 111 |
its actions and does `setstate(eofbit)`, which may throw
|
| 112 |
+
`ios_base::failure` [[iostate.flags]], before returning.
|
| 113 |
|
| 114 |
If one of these called functions throws an exception, then unless
|
| 115 |
+
explicitly noted otherwise, the input function sets `badbit` in the
|
| 116 |
+
error state. If `badbit` is set in `exceptions()`, the input function
|
| 117 |
+
rethrows the exception without completing its actions, otherwise it does
|
| 118 |
+
not throw anything and proceeds as if the called function had returned a
|
| 119 |
failure indication.
|
| 120 |
|
| 121 |
+
##### Constructors <a id="istream.cons">[[istream.cons]]</a>
|
| 122 |
|
| 123 |
``` cpp
|
| 124 |
explicit basic_istream(basic_streambuf<charT, traits>* sb);
|
| 125 |
```
|
| 126 |
|
| 127 |
+
*Effects:* Initializes the base class subobject with
|
| 128 |
+
`basic_ios::init(sb)` [[basic.ios.cons]].
|
|
|
|
| 129 |
|
| 130 |
+
*Ensures:* `gcount() == 0`.
|
| 131 |
|
| 132 |
``` cpp
|
| 133 |
basic_istream(basic_istream&& rhs);
|
| 134 |
```
|
| 135 |
|
| 136 |
+
*Effects:* Default constructs the base class, copies the `gcount()` from
|
| 137 |
+
`rhs`, calls `basic_ios<charT, traits>::move(rhs)` to initialize the
|
| 138 |
+
base class, and sets the `gcount()` for `rhs` to 0.
|
|
|
|
| 139 |
|
| 140 |
``` cpp
|
| 141 |
virtual ~basic_istream();
|
| 142 |
```
|
| 143 |
|
|
|
|
|
|
|
| 144 |
*Remarks:* Does not perform any operations of `rdbuf()`.
|
| 145 |
|
| 146 |
+
##### Assignment and swap <a id="istream.assign">[[istream.assign]]</a>
|
| 147 |
|
| 148 |
``` cpp
|
| 149 |
basic_istream& operator=(basic_istream&& rhs);
|
| 150 |
```
|
| 151 |
|
| 152 |
+
*Effects:* Equivalent to: `swap(rhs)`.
|
| 153 |
|
| 154 |
*Returns:* `*this`.
|
| 155 |
|
| 156 |
``` cpp
|
| 157 |
void swap(basic_istream& rhs);
|
| 158 |
```
|
| 159 |
|
| 160 |
*Effects:* Calls `basic_ios<charT, traits>::swap(rhs)`. Exchanges the
|
| 161 |
values returned by `gcount()` and `rhs.gcount()`.
|
| 162 |
|
| 163 |
+
##### Class `basic_istream::sentry` <a id="istream.sentry">[[istream.sentry]]</a>
|
| 164 |
|
| 165 |
``` cpp
|
| 166 |
namespace std {
|
| 167 |
template<class charT, class traits = char_traits<charT>>
|
| 168 |
class basic_istream<charT, traits>::sentry {
|
|
|
|
| 169 |
bool ok_; // exposition only
|
| 170 |
public:
|
| 171 |
explicit sentry(basic_istream<charT, traits>& is, bool noskipws = false);
|
| 172 |
~sentry();
|
| 173 |
explicit operator bool() const { return ok_; }
|
|
|
|
| 218 |
```
|
| 219 |
|
| 220 |
If, after any preparation is completed, `is.good()` is `true`,
|
| 221 |
`ok_ != false` otherwise, `ok_ == false`. During preparation, the
|
| 222 |
constructor may call `setstate(failbit)` (which may throw
|
| 223 |
+
`ios_base::failure` [[iostate.flags]]).[^19]
|
| 224 |
|
| 225 |
``` cpp
|
| 226 |
~sentry();
|
| 227 |
```
|
| 228 |
|
|
|
|
| 230 |
|
| 231 |
``` cpp
|
| 232 |
explicit operator bool() const;
|
| 233 |
```
|
| 234 |
|
| 235 |
+
*Returns:* `ok_`.
|
| 236 |
|