tmp/tmpc1a9hsw6/{from.md → to.md}
RENAMED
|
@@ -7,11 +7,11 @@ namespace std {
|
|
| 7 |
class bad_alloc : public exception {
|
| 8 |
public:
|
| 9 |
bad_alloc() noexcept;
|
| 10 |
bad_alloc(const bad_alloc&) noexcept;
|
| 11 |
bad_alloc& operator=(const bad_alloc&) noexcept;
|
| 12 |
-
|
| 13 |
};
|
| 14 |
}
|
| 15 |
```
|
| 16 |
|
| 17 |
The class `bad_alloc` defines the type of objects thrown as exceptions
|
|
@@ -21,55 +21,64 @@ by the implementation to report a failure to allocate storage.
|
|
| 21 |
bad_alloc() noexcept;
|
| 22 |
```
|
| 23 |
|
| 24 |
*Effects:* Constructs an object of class `bad_alloc`.
|
| 25 |
|
| 26 |
-
*Remarks:* The result of calling `what()` on the newly constructed
|
| 27 |
-
object is implementation-defined.
|
| 28 |
-
|
| 29 |
``` cpp
|
| 30 |
bad_alloc(const bad_alloc&) noexcept;
|
| 31 |
bad_alloc& operator=(const bad_alloc&) noexcept;
|
| 32 |
```
|
| 33 |
|
| 34 |
*Effects:* Copies an object of class `bad_alloc`.
|
| 35 |
|
| 36 |
``` cpp
|
| 37 |
-
|
| 38 |
```
|
| 39 |
|
| 40 |
*Returns:* An *implementation-defined* NTBS.
|
| 41 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 42 |
#### Class `bad_array_new_length` <a id="new.badlength">[[new.badlength]]</a>
|
| 43 |
|
| 44 |
``` cpp
|
| 45 |
namespace std {
|
| 46 |
class bad_array_new_length : public bad_alloc {
|
| 47 |
public:
|
| 48 |
bad_array_new_length() noexcept;
|
|
|
|
| 49 |
};
|
| 50 |
}
|
| 51 |
```
|
| 52 |
|
| 53 |
The class `bad_array_new_length` defines the type of objects thrown as
|
| 54 |
exceptions by the implementation to report an attempt to allocate an
|
| 55 |
-
array of size less than zero or greater than an implementation-defined
|
| 56 |
limit ([[expr.new]]).
|
| 57 |
|
| 58 |
``` cpp
|
| 59 |
bad_array_new_length() noexcept;
|
| 60 |
```
|
| 61 |
|
| 62 |
*Effects:* constructs an object of class `bad_array_new_length`.
|
| 63 |
|
| 64 |
-
|
| 65 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 66 |
|
| 67 |
#### Type `new_handler` <a id="new.handler">[[new.handler]]</a>
|
| 68 |
|
| 69 |
``` cpp
|
| 70 |
-
|
| 71 |
```
|
| 72 |
|
| 73 |
The type of a *handler function* to be called by `operator new()` or
|
| 74 |
`operator new[]()` ([[new.delete]]) when they cannot satisfy a request
|
| 75 |
for additional storage.
|
|
@@ -77,11 +86,11 @@ for additional storage.
|
|
| 77 |
*Required behavior:* A `new_handler` shall perform one of the following:
|
| 78 |
|
| 79 |
- make more storage available for allocation and then return;
|
| 80 |
- throw an exception of type `bad_alloc` or a class derived from
|
| 81 |
`bad_alloc`;
|
| 82 |
-
- terminate execution of the program without returning to the caller
|
| 83 |
|
| 84 |
#### `set_new_handler` <a id="set.new.handler">[[set.new.handler]]</a>
|
| 85 |
|
| 86 |
``` cpp
|
| 87 |
new_handler set_new_handler(new_handler new_p) noexcept;
|
|
@@ -98,7 +107,9 @@ new_handler set_new_handler(new_handler new_p) noexcept;
|
|
| 98 |
|
| 99 |
``` cpp
|
| 100 |
new_handler get_new_handler() noexcept;
|
| 101 |
```
|
| 102 |
|
| 103 |
-
*Returns:* The current `new_handler`.
|
|
|
|
|
|
|
| 104 |
|
|
|
|
| 7 |
class bad_alloc : public exception {
|
| 8 |
public:
|
| 9 |
bad_alloc() noexcept;
|
| 10 |
bad_alloc(const bad_alloc&) noexcept;
|
| 11 |
bad_alloc& operator=(const bad_alloc&) noexcept;
|
| 12 |
+
const char* what() const noexcept override;
|
| 13 |
};
|
| 14 |
}
|
| 15 |
```
|
| 16 |
|
| 17 |
The class `bad_alloc` defines the type of objects thrown as exceptions
|
|
|
|
| 21 |
bad_alloc() noexcept;
|
| 22 |
```
|
| 23 |
|
| 24 |
*Effects:* Constructs an object of class `bad_alloc`.
|
| 25 |
|
|
|
|
|
|
|
|
|
|
| 26 |
``` cpp
|
| 27 |
bad_alloc(const bad_alloc&) noexcept;
|
| 28 |
bad_alloc& operator=(const bad_alloc&) noexcept;
|
| 29 |
```
|
| 30 |
|
| 31 |
*Effects:* Copies an object of class `bad_alloc`.
|
| 32 |
|
| 33 |
``` cpp
|
| 34 |
+
const char* what() const noexcept override;
|
| 35 |
```
|
| 36 |
|
| 37 |
*Returns:* An *implementation-defined* NTBS.
|
| 38 |
|
| 39 |
+
*Remarks:* The message may be a null-terminated multibyte
|
| 40 |
+
string ([[multibyte.strings]]), suitable for conversion and display as
|
| 41 |
+
a `wstring` ([[string.classes]], [[locale.codecvt]]).
|
| 42 |
+
|
| 43 |
#### Class `bad_array_new_length` <a id="new.badlength">[[new.badlength]]</a>
|
| 44 |
|
| 45 |
``` cpp
|
| 46 |
namespace std {
|
| 47 |
class bad_array_new_length : public bad_alloc {
|
| 48 |
public:
|
| 49 |
bad_array_new_length() noexcept;
|
| 50 |
+
const char* what() const noexcept override;
|
| 51 |
};
|
| 52 |
}
|
| 53 |
```
|
| 54 |
|
| 55 |
The class `bad_array_new_length` defines the type of objects thrown as
|
| 56 |
exceptions by the implementation to report an attempt to allocate an
|
| 57 |
+
array of size less than zero or greater than an *implementation-defined*
|
| 58 |
limit ([[expr.new]]).
|
| 59 |
|
| 60 |
``` cpp
|
| 61 |
bad_array_new_length() noexcept;
|
| 62 |
```
|
| 63 |
|
| 64 |
*Effects:* constructs an object of class `bad_array_new_length`.
|
| 65 |
|
| 66 |
+
``` cpp
|
| 67 |
+
const char* what() const noexcept override;
|
| 68 |
+
```
|
| 69 |
+
|
| 70 |
+
*Returns:* An *implementation-defined* NTBS.
|
| 71 |
+
|
| 72 |
+
*Remarks:* The message may be a null-terminated multibyte
|
| 73 |
+
string ([[multibyte.strings]]), suitable for conversion and display as
|
| 74 |
+
a `wstring` ([[string.classes]], [[locale.codecvt]]).
|
| 75 |
|
| 76 |
#### Type `new_handler` <a id="new.handler">[[new.handler]]</a>
|
| 77 |
|
| 78 |
``` cpp
|
| 79 |
+
using new_handler = void (*)();
|
| 80 |
```
|
| 81 |
|
| 82 |
The type of a *handler function* to be called by `operator new()` or
|
| 83 |
`operator new[]()` ([[new.delete]]) when they cannot satisfy a request
|
| 84 |
for additional storage.
|
|
|
|
| 86 |
*Required behavior:* A `new_handler` shall perform one of the following:
|
| 87 |
|
| 88 |
- make more storage available for allocation and then return;
|
| 89 |
- throw an exception of type `bad_alloc` or a class derived from
|
| 90 |
`bad_alloc`;
|
| 91 |
+
- terminate execution of the program without returning to the caller.
|
| 92 |
|
| 93 |
#### `set_new_handler` <a id="set.new.handler">[[set.new.handler]]</a>
|
| 94 |
|
| 95 |
``` cpp
|
| 96 |
new_handler set_new_handler(new_handler new_p) noexcept;
|
|
|
|
| 107 |
|
| 108 |
``` cpp
|
| 109 |
new_handler get_new_handler() noexcept;
|
| 110 |
```
|
| 111 |
|
| 112 |
+
*Returns:* The current `new_handler`.
|
| 113 |
+
|
| 114 |
+
[*Note 1*: This may be a null pointer value. — *end note*]
|
| 115 |
|