tmp/tmpiup4kfv9/{from.md → to.md}
RENAMED
|
@@ -12,51 +12,43 @@ namespace std {
|
|
| 12 |
class bad_cast;
|
| 13 |
class bad_typeid;
|
| 14 |
}
|
| 15 |
```
|
| 16 |
|
| 17 |
-
[[expr.dynamic.cast]], [[expr.typeid]].
|
| 18 |
-
|
| 19 |
### Class `type_info` <a id="type.info">[[type.info]]</a>
|
| 20 |
|
| 21 |
``` cpp
|
| 22 |
namespace std {
|
| 23 |
class type_info {
|
| 24 |
public:
|
| 25 |
virtual ~type_info();
|
| 26 |
bool operator==(const type_info& rhs) const noexcept;
|
| 27 |
-
bool operator!=(const type_info& rhs) const noexcept;
|
| 28 |
bool before(const type_info& rhs) const noexcept;
|
| 29 |
size_t hash_code() const noexcept;
|
| 30 |
const char* name() const noexcept;
|
| 31 |
|
| 32 |
-
type_info(const type_info&
|
| 33 |
-
type_info& operator=(const type_info&
|
| 34 |
};
|
| 35 |
}
|
| 36 |
```
|
| 37 |
|
| 38 |
The class `type_info` describes type information generated by the
|
| 39 |
-
implementation. Objects of this class effectively store
|
| 40 |
-
name for the type, and an encoded value suitable for
|
| 41 |
-
for equality or collating order. The names, encoding
|
| 42 |
-
sequence for types are all unspecified and may
|
|
|
|
| 43 |
|
| 44 |
``` cpp
|
| 45 |
bool operator==(const type_info& rhs) const noexcept;
|
| 46 |
```
|
| 47 |
|
| 48 |
*Effects:* Compares the current object with `rhs`.
|
| 49 |
|
| 50 |
*Returns:* `true` if the two values describe the same type.
|
| 51 |
|
| 52 |
-
``` cpp
|
| 53 |
-
bool operator!=(const type_info& rhs) const noexcept;
|
| 54 |
-
```
|
| 55 |
-
|
| 56 |
-
*Returns:* `!(*this == rhs)`.
|
| 57 |
-
|
| 58 |
``` cpp
|
| 59 |
bool before(const type_info& rhs) const noexcept;
|
| 60 |
```
|
| 61 |
|
| 62 |
*Effects:* Compares the current object with `rhs`.
|
|
@@ -80,90 +72,52 @@ const char* name() const noexcept;
|
|
| 80 |
```
|
| 81 |
|
| 82 |
*Returns:* An *implementation-defined* NTBS.
|
| 83 |
|
| 84 |
*Remarks:* The message may be a null-terminated multibyte
|
| 85 |
-
string
|
| 86 |
-
|
| 87 |
|
| 88 |
### Class `bad_cast` <a id="bad.cast">[[bad.cast]]</a>
|
| 89 |
|
| 90 |
``` cpp
|
| 91 |
namespace std {
|
| 92 |
class bad_cast : public exception {
|
| 93 |
public:
|
| 94 |
-
|
| 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
|
| 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
|
| 126 |
-
string ([[multibyte.strings]]), suitable for conversion and display as
|
| 127 |
-
a `wstring` ([[string.classes]], [[locale.codecvt]])
|
| 128 |
-
|
| 129 |
### Class `bad_typeid` <a id="bad.typeid">[[bad.typeid]]</a>
|
| 130 |
|
| 131 |
``` cpp
|
| 132 |
namespace std {
|
| 133 |
class bad_typeid : public exception {
|
| 134 |
public:
|
| 135 |
-
|
| 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 |
-
|
| 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
|
| 167 |
-
string ([[multibyte.strings]]), suitable for conversion and display as
|
| 168 |
-
a `wstring` ([[string.classes]], [[locale.codecvt]])
|
| 169 |
-
|
|
|
|
| 12 |
class bad_cast;
|
| 13 |
class bad_typeid;
|
| 14 |
}
|
| 15 |
```
|
| 16 |
|
|
|
|
|
|
|
| 17 |
### Class `type_info` <a id="type.info">[[type.info]]</a>
|
| 18 |
|
| 19 |
``` cpp
|
| 20 |
namespace std {
|
| 21 |
class type_info {
|
| 22 |
public:
|
| 23 |
virtual ~type_info();
|
| 24 |
bool operator==(const type_info& rhs) const noexcept;
|
|
|
|
| 25 |
bool before(const type_info& rhs) const noexcept;
|
| 26 |
size_t hash_code() const noexcept;
|
| 27 |
const char* name() const noexcept;
|
| 28 |
|
| 29 |
+
type_info(const type_info&) = delete; // cannot be copied
|
| 30 |
+
type_info& operator=(const type_info&) = delete; // cannot be copied
|
| 31 |
};
|
| 32 |
}
|
| 33 |
```
|
| 34 |
|
| 35 |
The class `type_info` describes type information generated by the
|
| 36 |
+
implementation [[expr.typeid]]. Objects of this class effectively store
|
| 37 |
+
a pointer to a name for the type, and an encoded value suitable for
|
| 38 |
+
comparing two types for equality or collating order. The names, encoding
|
| 39 |
+
rule, and collating sequence for types are all unspecified and may
|
| 40 |
+
differ between programs.
|
| 41 |
|
| 42 |
``` cpp
|
| 43 |
bool operator==(const type_info& rhs) const noexcept;
|
| 44 |
```
|
| 45 |
|
| 46 |
*Effects:* Compares the current object with `rhs`.
|
| 47 |
|
| 48 |
*Returns:* `true` if the two values describe the same type.
|
| 49 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 50 |
``` cpp
|
| 51 |
bool before(const type_info& rhs) const noexcept;
|
| 52 |
```
|
| 53 |
|
| 54 |
*Effects:* Compares the current object with `rhs`.
|
|
|
|
| 72 |
```
|
| 73 |
|
| 74 |
*Returns:* An *implementation-defined* NTBS.
|
| 75 |
|
| 76 |
*Remarks:* The message may be a null-terminated multibyte
|
| 77 |
+
string [[multibyte.strings]], suitable for conversion and display as a
|
| 78 |
+
`wstring` ([[string.classes]], [[locale.codecvt]]).
|
| 79 |
|
| 80 |
### Class `bad_cast` <a id="bad.cast">[[bad.cast]]</a>
|
| 81 |
|
| 82 |
``` cpp
|
| 83 |
namespace std {
|
| 84 |
class bad_cast : public exception {
|
| 85 |
public:
|
| 86 |
+
// see [exception] for the specification of the special member functions
|
|
|
|
|
|
|
| 87 |
const char* what() const noexcept override;
|
| 88 |
};
|
| 89 |
}
|
| 90 |
```
|
| 91 |
|
| 92 |
The class `bad_cast` defines the type of objects thrown as exceptions by
|
| 93 |
the implementation to report the execution of an invalid `dynamic_cast`
|
| 94 |
+
expression [[expr.dynamic.cast]].
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 95 |
|
| 96 |
``` cpp
|
| 97 |
const char* what() const noexcept override;
|
| 98 |
```
|
| 99 |
|
| 100 |
*Returns:* An *implementation-defined* NTBS.
|
| 101 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 102 |
### Class `bad_typeid` <a id="bad.typeid">[[bad.typeid]]</a>
|
| 103 |
|
| 104 |
``` cpp
|
| 105 |
namespace std {
|
| 106 |
class bad_typeid : public exception {
|
| 107 |
public:
|
| 108 |
+
// see [exception] for the specification of the special member functions
|
|
|
|
|
|
|
| 109 |
const char* what() const noexcept override;
|
| 110 |
};
|
| 111 |
}
|
| 112 |
```
|
| 113 |
|
| 114 |
The class `bad_typeid` defines the type of objects thrown as exceptions
|
| 115 |
+
by the implementation to report a null pointer in a `typeid` expression
|
| 116 |
+
[[expr.typeid]].
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 117 |
|
| 118 |
``` cpp
|
| 119 |
const char* what() const noexcept override;
|
| 120 |
```
|
| 121 |
|
| 122 |
*Returns:* An *implementation-defined* NTBS.
|
| 123 |
|
|
|
|
|
|
|
|
|
|
|
|