tmp/tmp6o4bq_w7/{from.md → to.md}
RENAMED
|
@@ -15,33 +15,32 @@ namespace std {
|
|
| 15 |
|
| 16 |
The class `exception` defines the base class for the types of objects
|
| 17 |
thrown as exceptions by C++ standard library components, and certain
|
| 18 |
expressions, to report errors detected during program execution.
|
| 19 |
|
| 20 |
-
Each standard library class `T` that derives from class `exception`
|
| 21 |
-
|
| 22 |
-
|
| 23 |
-
These member functions shall meet the following postcondition: If two
|
| 24 |
-
objects `lhs` and `rhs` both have dynamic type `T` and `lhs` is a copy
|
| 25 |
-
of `rhs`, then `strcmp(lhs.what(), rhs.what())` shall equal 0.
|
| 26 |
|
| 27 |
-
|
| 28 |
-
|
| 29 |
-
|
|
|
|
| 30 |
|
| 31 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 32 |
|
| 33 |
``` cpp
|
| 34 |
exception(const exception& rhs) noexcept;
|
| 35 |
exception& operator=(const exception& rhs) noexcept;
|
| 36 |
```
|
| 37 |
|
| 38 |
-
*
|
| 39 |
-
|
| 40 |
-
*Postconditions:* If `*this` and `rhs` both have dynamic type
|
| 41 |
-
`exception` then the value of the expression
|
| 42 |
-
`strcmp(what(), rhs.what())` shall equal 0.
|
| 43 |
|
| 44 |
``` cpp
|
| 45 |
virtual ~exception();
|
| 46 |
```
|
| 47 |
|
|
@@ -52,11 +51,11 @@ virtual const char* what() const noexcept;
|
|
| 52 |
```
|
| 53 |
|
| 54 |
*Returns:* An *implementation-defined* NTBS.
|
| 55 |
|
| 56 |
*Remarks:* The message may be a null-terminated multibyte
|
| 57 |
-
string
|
| 58 |
-
|
| 59 |
remains valid until the exception object from which it is obtained is
|
| 60 |
destroyed or a non-`const` member function of the exception object is
|
| 61 |
called.
|
| 62 |
|
|
|
|
| 15 |
|
| 16 |
The class `exception` defines the base class for the types of objects
|
| 17 |
thrown as exceptions by C++ standard library components, and certain
|
| 18 |
expressions, to report errors detected during program execution.
|
| 19 |
|
| 20 |
+
Each standard library class `T` that derives from class `exception` has
|
| 21 |
+
the following publicly accessible member functions, each of them having
|
| 22 |
+
a non-throwing exception specification [[except.spec]]:
|
|
|
|
|
|
|
|
|
|
| 23 |
|
| 24 |
+
- default constructor (unless the class synopsis shows other
|
| 25 |
+
constructors)
|
| 26 |
+
- copy constructor
|
| 27 |
+
- copy assignment operator
|
| 28 |
|
| 29 |
+
The copy constructor and the copy assignment operator meet the following
|
| 30 |
+
postcondition: If two objects `lhs` and `rhs` both have dynamic type `T`
|
| 31 |
+
and `lhs` is a copy of `rhs`, then `strcmp(lhs.what(), rhs.what())` is
|
| 32 |
+
equal to `0`. The `what()` member function of each such `T` satisfies
|
| 33 |
+
the constraints specified for `exception::what()` (see below).
|
| 34 |
|
| 35 |
``` cpp
|
| 36 |
exception(const exception& rhs) noexcept;
|
| 37 |
exception& operator=(const exception& rhs) noexcept;
|
| 38 |
```
|
| 39 |
|
| 40 |
+
*Ensures:* If `*this` and `rhs` both have dynamic type `exception` then
|
| 41 |
+
the value of the expression `strcmp(what(), rhs.what())` shall equal 0.
|
|
|
|
|
|
|
|
|
|
| 42 |
|
| 43 |
``` cpp
|
| 44 |
virtual ~exception();
|
| 45 |
```
|
| 46 |
|
|
|
|
| 51 |
```
|
| 52 |
|
| 53 |
*Returns:* An *implementation-defined* NTBS.
|
| 54 |
|
| 55 |
*Remarks:* The message may be a null-terminated multibyte
|
| 56 |
+
string [[multibyte.strings]], suitable for conversion and display as a
|
| 57 |
+
`wstring` ([[string.classes]], [[locale.codecvt]]). The return value
|
| 58 |
remains valid until the exception object from which it is obtained is
|
| 59 |
destroyed or a non-`const` member function of the exception object is
|
| 60 |
called.
|
| 61 |
|