tmp/tmp1u9qmvcn/{from.md → to.md}
RENAMED
|
@@ -2,11 +2,11 @@
|
|
| 2 |
|
| 3 |
The header `<typeinfo>` defines a type associated with type information
|
| 4 |
generated by the implementation. It also defines two types for reporting
|
| 5 |
dynamic type identification errors.
|
| 6 |
|
| 7 |
-
|
| 8 |
|
| 9 |
``` cpp
|
| 10 |
namespace std {
|
| 11 |
class type_info;
|
| 12 |
class bad_cast;
|
|
@@ -70,12 +70,12 @@ size_t hash_code() const noexcept;
|
|
| 70 |
|
| 71 |
*Returns:* An unspecified value, except that within a single execution
|
| 72 |
of the program, it shall return the same value for any two `type_info`
|
| 73 |
objects which compare equal.
|
| 74 |
|
| 75 |
-
|
| 76 |
-
objects which do not compare equal.
|
| 77 |
|
| 78 |
``` cpp
|
| 79 |
const char* name() const noexcept;
|
| 80 |
```
|
| 81 |
|
|
@@ -92,37 +92,34 @@ namespace std {
|
|
| 92 |
class bad_cast : public exception {
|
| 93 |
public:
|
| 94 |
bad_cast() noexcept;
|
| 95 |
bad_cast(const bad_cast&) noexcept;
|
| 96 |
bad_cast& operator=(const bad_cast&) noexcept;
|
| 97 |
-
|
| 98 |
};
|
| 99 |
}
|
| 100 |
```
|
| 101 |
|
| 102 |
The class `bad_cast` defines the type of objects thrown as exceptions by
|
| 103 |
-
the implementation to report the execution of an invalid
|
| 104 |
expression ([[expr.dynamic.cast]]).
|
| 105 |
|
| 106 |
``` cpp
|
| 107 |
bad_cast() noexcept;
|
| 108 |
```
|
| 109 |
|
| 110 |
*Effects:* Constructs an object of class `bad_cast`.
|
| 111 |
|
| 112 |
-
*Remarks:* The result of calling `what()` on the newly constructed
|
| 113 |
-
object is implementation-defined.
|
| 114 |
-
|
| 115 |
``` cpp
|
| 116 |
bad_cast(const bad_cast&) noexcept;
|
| 117 |
bad_cast& operator=(const bad_cast&) noexcept;
|
| 118 |
```
|
| 119 |
|
| 120 |
*Effects:* Copies an object of class `bad_cast`.
|
| 121 |
|
| 122 |
``` cpp
|
| 123 |
-
|
| 124 |
```
|
| 125 |
|
| 126 |
*Returns:* An *implementation-defined* NTBS.
|
| 127 |
|
| 128 |
*Remarks:* The message may be a null-terminated multibyte
|
|
@@ -136,37 +133,34 @@ namespace std {
|
|
| 136 |
class bad_typeid : public exception {
|
| 137 |
public:
|
| 138 |
bad_typeid() noexcept;
|
| 139 |
bad_typeid(const bad_typeid&) noexcept;
|
| 140 |
bad_typeid& operator=(const bad_typeid&) noexcept;
|
| 141 |
-
|
| 142 |
};
|
| 143 |
}
|
| 144 |
```
|
| 145 |
|
| 146 |
The class `bad_typeid` defines the type of objects thrown as exceptions
|
| 147 |
-
by the implementation to report a null pointer in a
|
| 148 |
expression ([[expr.typeid]]).
|
| 149 |
|
| 150 |
``` cpp
|
| 151 |
bad_typeid() noexcept;
|
| 152 |
```
|
| 153 |
|
| 154 |
*Effects:* Constructs an object of class `bad_typeid`.
|
| 155 |
|
| 156 |
-
*Remarks:* The result of calling `what()` on the newly constructed
|
| 157 |
-
object is implementation-defined.
|
| 158 |
-
|
| 159 |
``` cpp
|
| 160 |
bad_typeid(const bad_typeid&) noexcept;
|
| 161 |
bad_typeid& operator=(const bad_typeid&) noexcept;
|
| 162 |
```
|
| 163 |
|
| 164 |
*Effects:* Copies an object of class `bad_typeid`.
|
| 165 |
|
| 166 |
``` cpp
|
| 167 |
-
|
| 168 |
```
|
| 169 |
|
| 170 |
*Returns:* An *implementation-defined* NTBS.
|
| 171 |
|
| 172 |
*Remarks:* The message may be a null-terminated multibyte
|
|
|
|
| 2 |
|
| 3 |
The header `<typeinfo>` defines a type associated with type information
|
| 4 |
generated by the implementation. It also defines two types for reporting
|
| 5 |
dynamic type identification errors.
|
| 6 |
|
| 7 |
+
### Header `<typeinfo>` synopsis <a id="typeinfo.syn">[[typeinfo.syn]]</a>
|
| 8 |
|
| 9 |
``` cpp
|
| 10 |
namespace std {
|
| 11 |
class type_info;
|
| 12 |
class bad_cast;
|
|
|
|
| 70 |
|
| 71 |
*Returns:* An unspecified value, except that within a single execution
|
| 72 |
of the program, it shall return the same value for any two `type_info`
|
| 73 |
objects which compare equal.
|
| 74 |
|
| 75 |
+
*Remarks:* An implementation should return different values for two
|
| 76 |
+
`type_info` objects which do not compare equal.
|
| 77 |
|
| 78 |
``` cpp
|
| 79 |
const char* name() const noexcept;
|
| 80 |
```
|
| 81 |
|
|
|
|
| 92 |
class bad_cast : public exception {
|
| 93 |
public:
|
| 94 |
bad_cast() noexcept;
|
| 95 |
bad_cast(const bad_cast&) noexcept;
|
| 96 |
bad_cast& operator=(const bad_cast&) noexcept;
|
| 97 |
+
const char* what() const noexcept override;
|
| 98 |
};
|
| 99 |
}
|
| 100 |
```
|
| 101 |
|
| 102 |
The class `bad_cast` defines the type of objects thrown as exceptions by
|
| 103 |
+
the implementation to report the execution of an invalid `dynamic_cast`
|
| 104 |
expression ([[expr.dynamic.cast]]).
|
| 105 |
|
| 106 |
``` cpp
|
| 107 |
bad_cast() noexcept;
|
| 108 |
```
|
| 109 |
|
| 110 |
*Effects:* Constructs an object of class `bad_cast`.
|
| 111 |
|
|
|
|
|
|
|
|
|
|
| 112 |
``` cpp
|
| 113 |
bad_cast(const bad_cast&) noexcept;
|
| 114 |
bad_cast& operator=(const bad_cast&) noexcept;
|
| 115 |
```
|
| 116 |
|
| 117 |
*Effects:* Copies an object of class `bad_cast`.
|
| 118 |
|
| 119 |
``` cpp
|
| 120 |
+
const char* what() const noexcept override;
|
| 121 |
```
|
| 122 |
|
| 123 |
*Returns:* An *implementation-defined* NTBS.
|
| 124 |
|
| 125 |
*Remarks:* The message may be a null-terminated multibyte
|
|
|
|
| 133 |
class bad_typeid : public exception {
|
| 134 |
public:
|
| 135 |
bad_typeid() noexcept;
|
| 136 |
bad_typeid(const bad_typeid&) noexcept;
|
| 137 |
bad_typeid& operator=(const bad_typeid&) noexcept;
|
| 138 |
+
const char* what() const noexcept override;
|
| 139 |
};
|
| 140 |
}
|
| 141 |
```
|
| 142 |
|
| 143 |
The class `bad_typeid` defines the type of objects thrown as exceptions
|
| 144 |
+
by the implementation to report a null pointer in a `typeid`
|
| 145 |
expression ([[expr.typeid]]).
|
| 146 |
|
| 147 |
``` cpp
|
| 148 |
bad_typeid() noexcept;
|
| 149 |
```
|
| 150 |
|
| 151 |
*Effects:* Constructs an object of class `bad_typeid`.
|
| 152 |
|
|
|
|
|
|
|
|
|
|
| 153 |
``` cpp
|
| 154 |
bad_typeid(const bad_typeid&) noexcept;
|
| 155 |
bad_typeid& operator=(const bad_typeid&) noexcept;
|
| 156 |
```
|
| 157 |
|
| 158 |
*Effects:* Copies an object of class `bad_typeid`.
|
| 159 |
|
| 160 |
``` cpp
|
| 161 |
+
const char* what() const noexcept override;
|
| 162 |
```
|
| 163 |
|
| 164 |
*Returns:* An *implementation-defined* NTBS.
|
| 165 |
|
| 166 |
*Remarks:* The message may be a null-terminated multibyte
|