tmp/tmp4iotoa6q/{from.md → to.md}
RENAMED
|
@@ -0,0 +1,47 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
##### Class `ios_base::failure` <a id="ios.failure">[[ios.failure]]</a>
|
| 2 |
+
|
| 3 |
+
``` cpp
|
| 4 |
+
namespace std {
|
| 5 |
+
class ios_base::failure : public system_error {
|
| 6 |
+
public:
|
| 7 |
+
explicit failure(const string& msg, const error_code& ec = io_errc::stream);
|
| 8 |
+
explicit failure(const char* msg, const error_code& ec = io_errc::stream);
|
| 9 |
+
};
|
| 10 |
+
}
|
| 11 |
+
```
|
| 12 |
+
|
| 13 |
+
An implementation is permitted to define `ios_base::failure` as a
|
| 14 |
+
synonym for a class with equivalent functionality to class
|
| 15 |
+
`ios_base::failure` shown in this subclause.
|
| 16 |
+
|
| 17 |
+
[*Note 1*: When `ios_base::failure` is a synonym for another type, that
|
| 18 |
+
type is required to provide a nested type `failure` to emulate the
|
| 19 |
+
injected-class-name. — *end note*]
|
| 20 |
+
|
| 21 |
+
The class `failure` defines the base class for the types of all objects
|
| 22 |
+
thrown as exceptions, by functions in the iostreams library, to report
|
| 23 |
+
errors detected during stream buffer operations.
|
| 24 |
+
|
| 25 |
+
When throwing `ios_base::failure` exceptions, implementations should
|
| 26 |
+
provide values of `ec` that identify the specific reason for the
|
| 27 |
+
failure.
|
| 28 |
+
|
| 29 |
+
[*Note 2*: Errors arising from the operating system would typically be
|
| 30 |
+
reported as `system_category()` errors with an error value of the error
|
| 31 |
+
number reported by the operating system. Errors arising from within the
|
| 32 |
+
stream library would typically be reported as
|
| 33 |
+
`error_code(io_errc::stream,
|
| 34 |
+
iostream_category())`. — *end note*]
|
| 35 |
+
|
| 36 |
+
``` cpp
|
| 37 |
+
explicit failure(const string& msg, const error_code& ec = io_errc::stream);
|
| 38 |
+
```
|
| 39 |
+
|
| 40 |
+
*Effects:* Constructs the base class with `msg` and `ec`.
|
| 41 |
+
|
| 42 |
+
``` cpp
|
| 43 |
+
explicit failure(const char* msg, const error_code& ec = io_errc::stream);
|
| 44 |
+
```
|
| 45 |
+
|
| 46 |
+
*Effects:* Constructs the base class with `msg` and `ec`.
|
| 47 |
+
|