From Jason Turner

[basic.stc.dynamic.deallocation]

Diff to HTML by rtfpessoa

Files changed (1) hide show
  1. tmp/tmpodhqbcbx/{from.md → to.md} +31 -23
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. If a class `T` has a member deallocation function named
11
- `operator` `delete` with exactly one parameter, then that function is a
12
- usual (non-placement) deallocation function. If class `T` does not
13
- declare such an `operator` `delete` but does declare a member
14
- deallocation function named `operator` `delete` with exactly two
15
- parameters, the second of which has type `std::size_t` (
16
- [[support.types]]), then this function is a usual deallocation function.
17
- Similarly, if a class `T` has a member deallocation function named
18
- `operator` `delete[]` with exactly one parameter, then that function is
19
- a usual (non-placement) deallocation function. If class `T` does not
20
- declare such an `operator` `delete[]` but does declare a member
21
- deallocation function named `operator` `delete[]` with exactly two
22
- parameters, the second of which has type `std::size_t`, then this
23
- function is a usual deallocation function. A deallocation function can
24
- be an instance of a function template. Neither the first parameter nor
25
- the return type shall depend on a template parameter. That is, a
26
- deallocation function template shall have a first parameter of type
27
- `void*` and a return type of `void` (as specified above). A deallocation
28
- function template shall have two or more function parameters. A template
29
- instance is never a usual deallocation function, regardless of its
30
- signature.
 
 
 
 
 
 
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
- *deallocated storage*. The effect of using an invalid pointer value
51
- (including passing it to a deallocation function) is undefined.[^12]
 
 
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