tmp/tmpcyplw7og/{from.md → to.md}
RENAMED
|
@@ -1,14 +1,14 @@
|
|
| 1 |
#### Non-allocating forms <a id="new.delete.placement">[[new.delete.placement]]</a>
|
| 2 |
|
| 3 |
-
These functions are reserved; a C++program may not define functions
|
| 4 |
-
displace the versions in the C++standard library
|
| 5 |
-
provisions of [[basic.stc.dynamic]] do not apply to these reserved
|
| 6 |
placement forms of `operator new` and `operator delete`.
|
| 7 |
|
| 8 |
``` cpp
|
| 9 |
-
void* operator new(std::size_t size, void* ptr) noexcept;
|
| 10 |
```
|
| 11 |
|
| 12 |
*Returns:* `ptr`.
|
| 13 |
|
| 14 |
*Remarks:* Intentionally performs no other action.
|
|
@@ -23,11 +23,11 @@ Something* p = new (place) Something();
|
|
| 23 |
```
|
| 24 |
|
| 25 |
— *end example*]
|
| 26 |
|
| 27 |
``` cpp
|
| 28 |
-
void* operator new[](std::size_t size, void* ptr) noexcept;
|
| 29 |
```
|
| 30 |
|
| 31 |
*Returns:* `ptr`.
|
| 32 |
|
| 33 |
*Remarks:* Intentionally performs no other action.
|
|
@@ -36,29 +36,27 @@ void* operator new[](std::size_t size, void* ptr) noexcept;
|
|
| 36 |
void operator delete(void* ptr, void*) noexcept;
|
| 37 |
```
|
| 38 |
|
| 39 |
*Effects:* Intentionally performs no action.
|
| 40 |
|
| 41 |
-
*
|
| 42 |
-
safety
|
| 43 |
-
|
| 44 |
|
| 45 |
*Remarks:* Default function called when any part of the initialization
|
| 46 |
in a placement *new-expression* that invokes the library’s non-array
|
| 47 |
-
placement operator new terminates by throwing an
|
| 48 |
-
exception ([[expr.new]]).
|
| 49 |
|
| 50 |
``` cpp
|
| 51 |
void operator delete[](void* ptr, void*) noexcept;
|
| 52 |
```
|
| 53 |
|
| 54 |
*Effects:* Intentionally performs no action.
|
| 55 |
|
| 56 |
-
*
|
| 57 |
-
safety
|
| 58 |
-
|
| 59 |
|
| 60 |
*Remarks:* Default function called when any part of the initialization
|
| 61 |
in a placement *new-expression* that invokes the library’s array
|
| 62 |
-
placement operator new terminates by throwing an
|
| 63 |
-
exception ([[expr.new]]).
|
| 64 |
|
|
|
|
| 1 |
#### Non-allocating forms <a id="new.delete.placement">[[new.delete.placement]]</a>
|
| 2 |
|
| 3 |
+
These functions are reserved; a C++ program may not define functions
|
| 4 |
+
that displace the versions in the C++ standard library [[constraints]].
|
| 5 |
+
The provisions of [[basic.stc.dynamic]] do not apply to these reserved
|
| 6 |
placement forms of `operator new` and `operator delete`.
|
| 7 |
|
| 8 |
``` cpp
|
| 9 |
+
[[nodiscard]] void* operator new(std::size_t size, void* ptr) noexcept;
|
| 10 |
```
|
| 11 |
|
| 12 |
*Returns:* `ptr`.
|
| 13 |
|
| 14 |
*Remarks:* Intentionally performs no other action.
|
|
|
|
| 23 |
```
|
| 24 |
|
| 25 |
— *end example*]
|
| 26 |
|
| 27 |
``` cpp
|
| 28 |
+
[[nodiscard]] void* operator new[](std::size_t size, void* ptr) noexcept;
|
| 29 |
```
|
| 30 |
|
| 31 |
*Returns:* `ptr`.
|
| 32 |
|
| 33 |
*Remarks:* Intentionally performs no other action.
|
|
|
|
| 36 |
void operator delete(void* ptr, void*) noexcept;
|
| 37 |
```
|
| 38 |
|
| 39 |
*Effects:* Intentionally performs no action.
|
| 40 |
|
| 41 |
+
*Preconditions:* If an implementation has strict pointer
|
| 42 |
+
safety [[basic.stc.dynamic.safety]] then `ptr` is a safely-derived
|
| 43 |
+
pointer.
|
| 44 |
|
| 45 |
*Remarks:* Default function called when any part of the initialization
|
| 46 |
in a placement *new-expression* that invokes the library’s non-array
|
| 47 |
+
placement operator new terminates by throwing an exception [[expr.new]].
|
|
|
|
| 48 |
|
| 49 |
``` cpp
|
| 50 |
void operator delete[](void* ptr, void*) noexcept;
|
| 51 |
```
|
| 52 |
|
| 53 |
*Effects:* Intentionally performs no action.
|
| 54 |
|
| 55 |
+
*Preconditions:* If an implementation has strict pointer
|
| 56 |
+
safety [[basic.stc.dynamic.safety]] then `ptr` is a safely-derived
|
| 57 |
+
pointer.
|
| 58 |
|
| 59 |
*Remarks:* Default function called when any part of the initialization
|
| 60 |
in a placement *new-expression* that invokes the library’s array
|
| 61 |
+
placement operator new terminates by throwing an exception [[expr.new]].
|
|
|
|
| 62 |
|