From Jason Turner

[syserr.syserr]

Diff to HTML by rtfpessoa

Files changed (1) hide show
  1. tmp/tmp0jm6qfaz/{from.md → to.md} +19 -18
tmp/tmp0jm6qfaz/{from.md → to.md} RENAMED
@@ -5,30 +5,28 @@
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
- If an error represents an out-of-memory condition, implementations are
11
- encouraged to throw an exception object of type `bad_alloc` 
12
- [[bad.alloc]] rather than `system_error`.
13
 
14
  ``` cpp
15
  namespace std {
16
  class system_error : public runtime_error {
17
  public:
18
  system_error(error_code ec, const string& what_arg);
19
  system_error(error_code ec, const char* what_arg);
20
  system_error(error_code ec);
21
- system_error(int ev, const error_category& ecat,
22
- const string& what_arg);
23
- system_error(int ev, const error_category& ecat,
24
- const char* what_arg);
25
  system_error(int ev, const error_category& ecat);
26
  const error_code& code() const noexcept;
27
- const char* what() const noexcept;
28
  };
29
- } // namespace std
30
  ```
31
 
32
  #### Class `system_error` members <a id="syserr.syserr.members">[[syserr.syserr.members]]</a>
33
 
34
  ``` cpp
@@ -58,23 +56,21 @@ system_error(error_code ec);
58
  *Effects:* Constructs an object of class `system_error`.
59
 
60
  *Postconditions:* `code() == ec`.
61
 
62
  ``` cpp
63
- system_error(int ev, const error_category& ecat,
64
- const string& what_arg);
65
  ```
66
 
67
  *Effects:* Constructs an object of class `system_error`.
68
 
69
  *Postconditions:* `code() == error_code(ev, ecat)`.
70
 
71
  `string(what()).find(what_arg) != string::npos`.
72
 
73
  ``` cpp
74
- system_error(int ev, const error_category& ecat,
75
- const char* what_arg);
76
  ```
77
 
78
  *Effects:* Constructs an object of class `system_error`.
79
 
80
  *Postconditions:* `code() == error_code(ev, ecat)`.
@@ -95,23 +91,28 @@ const error_code& code() const noexcept;
95
 
96
  *Returns:* `ec` or `error_code(ev, ecat)`, from the constructor, as
97
  appropriate.
98
 
99
  ``` cpp
100
- const char* what() const noexcept;
101
  ```
102
 
103
  *Returns:* An NTBSincorporating the arguments supplied in the
104
  constructor.
105
 
106
- The returned NTBS might be the contents of
107
- `what_arg + ": " + code.message()`.
108
 
109
  <!-- Link reference definitions -->
110
  [assertions]: #assertions
 
111
  [bad.alloc]: language.md#bad.alloc
 
 
112
  [comparisons]: utilities.md#comparisons
 
 
113
  [diagnostics]: #diagnostics
114
  [diagnostics.general]: #diagnostics.general
115
  [domain.error]: #domain.error
116
  [errno]: #errno
117
  [invalid.argument]: #invalid.argument
@@ -121,10 +122,11 @@ The returned NTBS might be the contents of
121
  [overflow.error]: #overflow.error
122
  [range.error]: #range.error
123
  [res.on.exception.handling]: library.md#res.on.exception.handling
124
  [runtime.error]: #runtime.error
125
  [std.exceptions]: #std.exceptions
 
126
  [syserr]: #syserr
127
  [syserr.compare]: #syserr.compare
128
  [syserr.errcat]: #syserr.errcat
129
  [syserr.errcat.derived]: #syserr.errcat.derived
130
  [syserr.errcat.nonvirtuals]: #syserr.errcat.nonvirtuals
@@ -145,10 +147,9 @@ The returned NTBS might be the contents of
145
  [syserr.errcondition.overview]: #syserr.errcondition.overview
146
  [syserr.hash]: #syserr.hash
147
  [syserr.syserr]: #syserr.syserr
148
  [syserr.syserr.members]: #syserr.syserr.members
149
  [syserr.syserr.overview]: #syserr.syserr.overview
150
- [tab:diagnostics.hdr.cassert]: #tab:diagnostics.hdr.cassert
151
- [tab:diagnostics.hdr.cerrno]: #tab:diagnostics.hdr.cerrno
152
  [tab:diagnostics.lib.summary]: #tab:diagnostics.lib.summary
153
  [underflow.error]: #underflow.error
154
  [unord.hash]: utilities.md#unord.hash
 
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:
18
  system_error(error_code ec, const string& what_arg);
19
  system_error(error_code ec, const char* what_arg);
20
  system_error(error_code ec);
21
+ system_error(int ev, const error_category& ecat, const string& what_arg);
22
+ system_error(int ev, const error_category& ecat, const char* what_arg);
 
 
23
  system_error(int ev, const error_category& ecat);
24
  const error_code& code() const noexcept;
25
+ const char* what() const noexcept override;
26
  };
27
+ }
28
  ```
29
 
30
  #### Class `system_error` members <a id="syserr.syserr.members">[[syserr.syserr.members]]</a>
31
 
32
  ``` cpp
 
56
  *Effects:* Constructs an object of class `system_error`.
57
 
58
  *Postconditions:* `code() == ec`.
59
 
60
  ``` cpp
61
+ system_error(int ev, const error_category& ecat, const string& what_arg);
 
62
  ```
63
 
64
  *Effects:* Constructs an object of class `system_error`.
65
 
66
  *Postconditions:* `code() == error_code(ev, ecat)`.
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
  *Effects:* Constructs an object of class `system_error`.
75
 
76
  *Postconditions:* `code() == error_code(ev, ecat)`.
 
91
 
92
  *Returns:* `ec` or `error_code(ev, ecat)`, from the constructor, as
93
  appropriate.
94
 
95
  ``` cpp
96
+ const char* what() const noexcept override;
97
  ```
98
 
99
  *Returns:* An NTBSincorporating the arguments supplied in the
100
  constructor.
101
 
102
+ [*Note 1*: The returned NTBSmight be the contents of
103
+ `what_arg + ": " + code.message()`. — *end note*]
104
 
105
  <!-- Link reference definitions -->
106
  [assertions]: #assertions
107
+ [assertions.assert]: #assertions.assert
108
  [bad.alloc]: language.md#bad.alloc
109
+ [cassert.syn]: #cassert.syn
110
+ [cerrno.syn]: #cerrno.syn
111
  [comparisons]: utilities.md#comparisons
112
+ [conv]: conv.md#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
 
122
  [overflow.error]: #overflow.error
123
  [range.error]: #range.error
124
  [res.on.exception.handling]: library.md#res.on.exception.handling
125
  [runtime.error]: #runtime.error
126
  [std.exceptions]: #std.exceptions
127
+ [stdexcept.syn]: #stdexcept.syn
128
  [syserr]: #syserr
129
  [syserr.compare]: #syserr.compare
130
  [syserr.errcat]: #syserr.errcat
131
  [syserr.errcat.derived]: #syserr.errcat.derived
132
  [syserr.errcat.nonvirtuals]: #syserr.errcat.nonvirtuals
 
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
+ [system_error.syn]: #system_error.syn
 
153
  [tab:diagnostics.lib.summary]: #tab:diagnostics.lib.summary
154
  [underflow.error]: #underflow.error
155
  [unord.hash]: utilities.md#unord.hash