tmp/tmprbexm4uw/{from.md → to.md}
RENAMED
|
@@ -1,24 +1,25 @@
|
|
| 1 |
#### Unformatted output functions <a id="ostream.unformatted">[[ostream.unformatted]]</a>
|
| 2 |
|
| 3 |
Each unformatted output function begins execution by constructing an
|
| 4 |
-
object of class `sentry`. If
|
| 5 |
converting to a value of type `bool`, the function endeavors to generate
|
| 6 |
the requested output. If an exception is thrown during output, then
|
| 7 |
-
`ios_base::badbit` is
|
| 8 |
-
|
| 9 |
-
|
| 10 |
-
|
| 11 |
-
|
|
|
|
| 12 |
|
| 13 |
``` cpp
|
| 14 |
-
basic_ostream
|
| 15 |
```
|
| 16 |
|
| 17 |
*Effects:* Behaves as an unformatted output function (as described
|
| 18 |
-
above). After constructing a sentry object, inserts the character `c`,
|
| 19 |
-
if possible.[^
|
| 20 |
|
| 21 |
Otherwise, calls `setstate(badbit)` (which may throw `ios_base::failure`
|
| 22 |
[[iostate.flags]]).
|
| 23 |
|
| 24 |
*Returns:* `*this`.
|
|
@@ -26,14 +27,15 @@ Otherwise, calls `setstate(badbit)` (which may throw `ios_base::failure`
|
|
| 26 |
``` cpp
|
| 27 |
basic_ostream& write(const char_type* s, streamsize n);
|
| 28 |
```
|
| 29 |
|
| 30 |
*Effects:* Behaves as an unformatted output function (as described
|
| 31 |
-
above). After constructing a sentry object, obtains characters to
|
| 32 |
-
from successive locations of an array whose first element is
|
| 33 |
-
by `s`.[^
|
| 34 |
-
|
|
|
|
| 35 |
|
| 36 |
- `n` characters are inserted;
|
| 37 |
- inserting in the output sequence fails (in which case the function
|
| 38 |
calls `setstate(badbit)`, which may throw `ios_base::failure`
|
| 39 |
[[iostate.flags]]).
|
|
@@ -43,14 +45,14 @@ occurs:
|
|
| 43 |
``` cpp
|
| 44 |
basic_ostream& flush();
|
| 45 |
```
|
| 46 |
|
| 47 |
*Effects:* Behaves as an unformatted output function (as described
|
| 48 |
-
above). If `rdbuf()` is not a null pointer, constructs a sentry
|
| 49 |
-
If
|
| 50 |
-
the function calls `rdbuf()->pubsync()`. If that function returns
|
| 51 |
-
calls `setstate(badbit)` (which may throw `ios_base::failure`
|
| 52 |
-
[[iostate.flags]]). Otherwise, if the sentry object returns `false`,
|
| 53 |
does nothing.
|
| 54 |
|
| 55 |
*Returns:* `*this`.
|
| 56 |
|
|
|
|
| 1 |
#### Unformatted output functions <a id="ostream.unformatted">[[ostream.unformatted]]</a>
|
| 2 |
|
| 3 |
Each unformatted output function begins execution by constructing an
|
| 4 |
+
object of class `sentry`. If that object returns `true`, while
|
| 5 |
converting to a value of type `bool`, the function endeavors to generate
|
| 6 |
the requested output. If an exception is thrown during output, then
|
| 7 |
+
`ios_base::badbit` is set[^34]
|
| 8 |
+
|
| 9 |
+
in `*this`’s error state. If `(exceptions() & badbit) != 0` then the
|
| 10 |
+
exception is rethrown. In any case, the unformatted output function ends
|
| 11 |
+
by destroying the `sentry` object, then, if no exception was thrown,
|
| 12 |
+
returning the value specified for the unformatted output function.
|
| 13 |
|
| 14 |
``` cpp
|
| 15 |
+
basic_ostream& put(char_type c);
|
| 16 |
```
|
| 17 |
|
| 18 |
*Effects:* Behaves as an unformatted output function (as described
|
| 19 |
+
above). After constructing a `sentry` object, inserts the character `c`,
|
| 20 |
+
if possible.[^35]
|
| 21 |
|
| 22 |
Otherwise, calls `setstate(badbit)` (which may throw `ios_base::failure`
|
| 23 |
[[iostate.flags]]).
|
| 24 |
|
| 25 |
*Returns:* `*this`.
|
|
|
|
| 27 |
``` cpp
|
| 28 |
basic_ostream& write(const char_type* s, streamsize n);
|
| 29 |
```
|
| 30 |
|
| 31 |
*Effects:* Behaves as an unformatted output function (as described
|
| 32 |
+
above). After constructing a `sentry` object, obtains characters to
|
| 33 |
+
insert from successive locations of an array whose first element is
|
| 34 |
+
designated by `s`.[^36]
|
| 35 |
+
|
| 36 |
+
Characters are inserted until either of the following occurs:
|
| 37 |
|
| 38 |
- `n` characters are inserted;
|
| 39 |
- inserting in the output sequence fails (in which case the function
|
| 40 |
calls `setstate(badbit)`, which may throw `ios_base::failure`
|
| 41 |
[[iostate.flags]]).
|
|
|
|
| 45 |
``` cpp
|
| 46 |
basic_ostream& flush();
|
| 47 |
```
|
| 48 |
|
| 49 |
*Effects:* Behaves as an unformatted output function (as described
|
| 50 |
+
above). If `rdbuf()` is not a null pointer, constructs a `sentry`
|
| 51 |
+
object. If that object returns `true` when converted to a value of type
|
| 52 |
+
`bool` the function calls `rdbuf()->pubsync()`. If that function returns
|
| 53 |
+
-1 calls `setstate(badbit)` (which may throw `ios_base::failure`
|
| 54 |
+
[[iostate.flags]]). Otherwise, if the `sentry` object returns `false`,
|
| 55 |
does nothing.
|
| 56 |
|
| 57 |
*Returns:* `*this`.
|
| 58 |
|