tmp/tmpodhqbcbx/{from.md → to.md}
RENAMED
|
@@ -5,31 +5,37 @@ functions; a program is ill-formed if deallocation functions are
|
|
| 5 |
declared in a namespace scope other than global scope or declared static
|
| 6 |
in global scope.
|
| 7 |
|
| 8 |
Each deallocation function shall return `void` and its first parameter
|
| 9 |
shall be `void*`. A deallocation function can have more than one
|
| 10 |
-
parameter.
|
| 11 |
-
|
| 12 |
-
|
| 13 |
-
|
| 14 |
-
|
| 15 |
-
|
| 16 |
-
|
| 17 |
-
|
| 18 |
-
`operator` `delete
|
| 19 |
-
a usual
|
| 20 |
-
|
| 21 |
-
|
| 22 |
-
|
| 23 |
-
function
|
| 24 |
-
|
| 25 |
-
|
| 26 |
-
|
| 27 |
-
|
| 28 |
-
|
| 29 |
-
|
| 30 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 31 |
|
| 32 |
If a deallocation function terminates by throwing an exception, the
|
| 33 |
behavior is undefined. The value of the first argument supplied to a
|
| 34 |
deallocation function may be a null pointer value; if so, and if the
|
| 35 |
deallocation function is one supplied in the standard library, the call
|
|
@@ -45,8 +51,10 @@ invocation of either `operator` `new[](std::size_t)` or `operator`
|
|
| 45 |
|
| 46 |
If the argument given to a deallocation function in the standard library
|
| 47 |
is a pointer that is not the null pointer value ([[conv.ptr]]), the
|
| 48 |
deallocation function shall deallocate the storage referenced by the
|
| 49 |
pointer, rendering invalid all pointers referring to any part of the
|
| 50 |
-
|
| 51 |
-
|
|
|
|
|
|
|
| 52 |
|
|
|
|
| 5 |
declared in a namespace scope other than global scope or declared static
|
| 6 |
in global scope.
|
| 7 |
|
| 8 |
Each deallocation function shall return `void` and its first parameter
|
| 9 |
shall be `void*`. A deallocation function can have more than one
|
| 10 |
+
parameter. The global `operator delete` with exactly one parameter is a
|
| 11 |
+
usual (non-placement) deallocation function. The global
|
| 12 |
+
`operator delete` with exactly two parameters, the second of which has
|
| 13 |
+
type `std::size_t`, is a usual deallocation function. Similarly, the
|
| 14 |
+
global `operator delete[]` with exactly one parameter is a usual
|
| 15 |
+
deallocation function. The global `operator delete[]` with exactly two
|
| 16 |
+
parameters, the second of which has type `std::size_t`, is a usual
|
| 17 |
+
deallocation function.[^13] If a class `T` has a member deallocation
|
| 18 |
+
function named `operator` `delete` with exactly one parameter, then that
|
| 19 |
+
function is a usual deallocation function. If class `T` does not declare
|
| 20 |
+
such an `operator` `delete` but does declare a member deallocation
|
| 21 |
+
function named `operator` `delete` with exactly two parameters, the
|
| 22 |
+
second of which has type `std::size_t`, then this function is a usual
|
| 23 |
+
deallocation function. Similarly, if a class `T` has a member
|
| 24 |
+
deallocation function named `operator` `delete[]` with exactly one
|
| 25 |
+
parameter, then that function is a usual (non-placement) deallocation
|
| 26 |
+
function. If class `T` does not declare such an `operator` `delete[]`
|
| 27 |
+
but does declare a member deallocation function named `operator`
|
| 28 |
+
`delete[]` with exactly two parameters, the second of which has type
|
| 29 |
+
`std::size_t`, then this function is a usual deallocation function. A
|
| 30 |
+
deallocation function can be an instance of a function template. Neither
|
| 31 |
+
the first parameter nor the return type shall depend on a template
|
| 32 |
+
parameter. That is, a deallocation function template shall have a first
|
| 33 |
+
parameter of type `void*` and a return type of `void` (as specified
|
| 34 |
+
above). A deallocation function template shall have two or more function
|
| 35 |
+
parameters. A template instance is never a usual deallocation function,
|
| 36 |
+
regardless of its signature.
|
| 37 |
|
| 38 |
If a deallocation function terminates by throwing an exception, the
|
| 39 |
behavior is undefined. The value of the first argument supplied to a
|
| 40 |
deallocation function may be a null pointer value; if so, and if the
|
| 41 |
deallocation function is one supplied in the standard library, the call
|
|
|
|
| 51 |
|
| 52 |
If the argument given to a deallocation function in the standard library
|
| 53 |
is a pointer that is not the null pointer value ([[conv.ptr]]), the
|
| 54 |
deallocation function shall deallocate the storage referenced by the
|
| 55 |
pointer, rendering invalid all pointers referring to any part of the
|
| 56 |
+
deallocated storage. Indirection through an invalid pointer value and
|
| 57 |
+
passing an invalid pointer value to a deallocation function have
|
| 58 |
+
undefined behavior. Any other use of an invalid pointer value has
|
| 59 |
+
implementation-defined behavior.[^14]
|
| 60 |
|