tmp/tmp8vo3bn6i/{from.md → to.md}
RENAMED
|
@@ -1,17 +1,17 @@
|
|
| 1 |
### Class `system_error` <a id="syserr.syserr">[[syserr.syserr]]</a>
|
| 2 |
|
| 3 |
-
####
|
| 4 |
|
| 5 |
The class `system_error` describes an exception object used to report
|
| 6 |
error conditions that have an associated error code. Such error
|
| 7 |
conditions typically originate from the operating system or other
|
| 8 |
low-level application program interfaces.
|
| 9 |
|
| 10 |
[*Note 1*: If an error represents an out-of-memory condition,
|
| 11 |
implementations are encouraged to throw an exception object of type
|
| 12 |
-
`bad_alloc`
|
| 13 |
|
| 14 |
``` cpp
|
| 15 |
namespace std {
|
| 16 |
class system_error : public runtime_error {
|
| 17 |
public:
|
|
@@ -25,67 +25,55 @@ namespace std {
|
|
| 25 |
const char* what() const noexcept override;
|
| 26 |
};
|
| 27 |
}
|
| 28 |
```
|
| 29 |
|
| 30 |
-
####
|
| 31 |
|
| 32 |
``` cpp
|
| 33 |
system_error(error_code ec, const string& what_arg);
|
| 34 |
```
|
| 35 |
|
| 36 |
-
*
|
| 37 |
-
|
| 38 |
-
*Postconditions:* `code() == ec`.
|
| 39 |
-
|
| 40 |
-
`string(what()).find(what_arg) != string::npos`.
|
| 41 |
|
| 42 |
``` cpp
|
| 43 |
system_error(error_code ec, const char* what_arg);
|
| 44 |
```
|
| 45 |
|
| 46 |
-
*
|
| 47 |
-
|
| 48 |
-
*Postconditions:* `code() == ec`.
|
| 49 |
-
|
| 50 |
-
`string(what()).find(what_arg) != string::npos`.
|
| 51 |
|
| 52 |
``` cpp
|
| 53 |
system_error(error_code ec);
|
| 54 |
```
|
| 55 |
|
| 56 |
-
*
|
| 57 |
-
|
| 58 |
-
*Postconditions:* `code() == ec`.
|
| 59 |
|
| 60 |
``` cpp
|
| 61 |
system_error(int ev, const error_category& ecat, const string& what_arg);
|
| 62 |
```
|
| 63 |
|
| 64 |
-
*
|
| 65 |
|
| 66 |
-
|
| 67 |
-
|
| 68 |
-
`string(what()).find(what_arg) != string::npos`.
|
| 69 |
|
| 70 |
``` cpp
|
| 71 |
system_error(int ev, const error_category& ecat, const char* what_arg);
|
| 72 |
```
|
| 73 |
|
| 74 |
-
*
|
| 75 |
|
| 76 |
-
|
| 77 |
-
|
| 78 |
-
`string(what()).find(what_arg) != string::npos`.
|
| 79 |
|
| 80 |
``` cpp
|
| 81 |
system_error(int ev, const error_category& ecat);
|
| 82 |
```
|
| 83 |
|
| 84 |
-
*
|
| 85 |
-
|
| 86 |
-
*Postconditions:* `code() == error_code(ev, ecat)`.
|
| 87 |
|
| 88 |
``` cpp
|
| 89 |
const error_code& code() const noexcept;
|
| 90 |
```
|
| 91 |
|
|
@@ -103,18 +91,19 @@ constructor.
|
|
| 103 |
`what_arg + ": " + code.message()`. — *end note*]
|
| 104 |
|
| 105 |
<!-- Link reference definitions -->
|
| 106 |
[assertions]: #assertions
|
| 107 |
[assertions.assert]: #assertions.assert
|
| 108 |
-
[bad.alloc]:
|
| 109 |
[cassert.syn]: #cassert.syn
|
| 110 |
[cerrno.syn]: #cerrno.syn
|
| 111 |
-
[comparisons]: utilities.md#comparisons
|
| 112 |
-
[conv]:
|
| 113 |
[defns.const.subexpr]: library.md#defns.const.subexpr
|
| 114 |
[diagnostics]: #diagnostics
|
| 115 |
[diagnostics.general]: #diagnostics.general
|
|
|
|
| 116 |
[domain.error]: #domain.error
|
| 117 |
[errno]: #errno
|
| 118 |
[invalid.argument]: #invalid.argument
|
| 119 |
[length.error]: #length.error
|
| 120 |
[logic.error]: #logic.error
|
|
@@ -147,9 +136,8 @@ constructor.
|
|
| 147 |
[syserr.errcondition.overview]: #syserr.errcondition.overview
|
| 148 |
[syserr.hash]: #syserr.hash
|
| 149 |
[syserr.syserr]: #syserr.syserr
|
| 150 |
[syserr.syserr.members]: #syserr.syserr.members
|
| 151 |
[syserr.syserr.overview]: #syserr.syserr.overview
|
| 152 |
-
[
|
| 153 |
-
[tab:diagnostics.lib.summary]: #tab:diagnostics.lib.summary
|
| 154 |
[underflow.error]: #underflow.error
|
| 155 |
[unord.hash]: utilities.md#unord.hash
|
|
|
|
| 1 |
### Class `system_error` <a id="syserr.syserr">[[syserr.syserr]]</a>
|
| 2 |
|
| 3 |
+
#### Overview <a id="syserr.syserr.overview">[[syserr.syserr.overview]]</a>
|
| 4 |
|
| 5 |
The class `system_error` describes an exception object used to report
|
| 6 |
error conditions that have an associated error code. Such error
|
| 7 |
conditions typically originate from the operating system or other
|
| 8 |
low-level application program interfaces.
|
| 9 |
|
| 10 |
[*Note 1*: If an error represents an out-of-memory condition,
|
| 11 |
implementations are encouraged to throw an exception object of type
|
| 12 |
+
`bad_alloc` [[bad.alloc]] rather than `system_error`. — *end note*]
|
| 13 |
|
| 14 |
``` cpp
|
| 15 |
namespace std {
|
| 16 |
class system_error : public runtime_error {
|
| 17 |
public:
|
|
|
|
| 25 |
const char* what() const noexcept override;
|
| 26 |
};
|
| 27 |
}
|
| 28 |
```
|
| 29 |
|
| 30 |
+
#### Members <a id="syserr.syserr.members">[[syserr.syserr.members]]</a>
|
| 31 |
|
| 32 |
``` cpp
|
| 33 |
system_error(error_code ec, const string& what_arg);
|
| 34 |
```
|
| 35 |
|
| 36 |
+
*Ensures:* `code() == ec` and
|
| 37 |
+
`string_view(what()).find(what_arg.c_str()) != string_view::npos`.
|
|
|
|
|
|
|
|
|
|
| 38 |
|
| 39 |
``` cpp
|
| 40 |
system_error(error_code ec, const char* what_arg);
|
| 41 |
```
|
| 42 |
|
| 43 |
+
*Ensures:* `code() == ec` and
|
| 44 |
+
`string_view(what()).find(what_arg) != string_view::npos`.
|
|
|
|
|
|
|
|
|
|
| 45 |
|
| 46 |
``` cpp
|
| 47 |
system_error(error_code ec);
|
| 48 |
```
|
| 49 |
|
| 50 |
+
*Ensures:* `code() == ec`.
|
|
|
|
|
|
|
| 51 |
|
| 52 |
``` cpp
|
| 53 |
system_error(int ev, const error_category& ecat, const string& what_arg);
|
| 54 |
```
|
| 55 |
|
| 56 |
+
*Ensures:*
|
| 57 |
|
| 58 |
+
`code() == error_code(ev, ecat)` and
|
| 59 |
+
`string_view(what()).find(what_arg.c_str()) != string_view::npos`.
|
|
|
|
| 60 |
|
| 61 |
``` cpp
|
| 62 |
system_error(int ev, const error_category& ecat, const char* what_arg);
|
| 63 |
```
|
| 64 |
|
| 65 |
+
*Ensures:*
|
| 66 |
|
| 67 |
+
`code() == error_code(ev, ecat)` and
|
| 68 |
+
`string_view(what()).find(what_arg) != string_view::npos`.
|
|
|
|
| 69 |
|
| 70 |
``` cpp
|
| 71 |
system_error(int ev, const error_category& ecat);
|
| 72 |
```
|
| 73 |
|
| 74 |
+
*Ensures:* `code() == error_code(ev, ecat)`.
|
|
|
|
|
|
|
| 75 |
|
| 76 |
``` cpp
|
| 77 |
const error_code& code() const noexcept;
|
| 78 |
```
|
| 79 |
|
|
|
|
| 91 |
`what_arg + ": " + code.message()`. — *end note*]
|
| 92 |
|
| 93 |
<!-- Link reference definitions -->
|
| 94 |
[assertions]: #assertions
|
| 95 |
[assertions.assert]: #assertions.assert
|
| 96 |
+
[bad.alloc]: support.md#bad.alloc
|
| 97 |
[cassert.syn]: #cassert.syn
|
| 98 |
[cerrno.syn]: #cerrno.syn
|
| 99 |
+
[comparisons.three.way]: utilities.md#comparisons.three.way
|
| 100 |
+
[conv]: expr.md#conv
|
| 101 |
[defns.const.subexpr]: library.md#defns.const.subexpr
|
| 102 |
[diagnostics]: #diagnostics
|
| 103 |
[diagnostics.general]: #diagnostics.general
|
| 104 |
+
[diagnostics.summary]: #diagnostics.summary
|
| 105 |
[domain.error]: #domain.error
|
| 106 |
[errno]: #errno
|
| 107 |
[invalid.argument]: #invalid.argument
|
| 108 |
[length.error]: #length.error
|
| 109 |
[logic.error]: #logic.error
|
|
|
|
| 136 |
[syserr.errcondition.overview]: #syserr.errcondition.overview
|
| 137 |
[syserr.hash]: #syserr.hash
|
| 138 |
[syserr.syserr]: #syserr.syserr
|
| 139 |
[syserr.syserr.members]: #syserr.syserr.members
|
| 140 |
[syserr.syserr.overview]: #syserr.syserr.overview
|
| 141 |
+
[system.error.syn]: #system.error.syn
|
|
|
|
| 142 |
[underflow.error]: #underflow.error
|
| 143 |
[unord.hash]: utilities.md#unord.hash
|