Remarks: It is unspecified under what conditions part or all of such
reclaimed storage will be allocated by subsequent
calls to
operator new
or any of
aligned_alloc,
calloc,
malloc,
or
realloc,
declared in
. If a replacement function
without a
size parameter
is defined by the program,
the program should also define the corresponding
function with a
size parameter
. If a replacement function
with a
size parameter
is defined by the program,
the program shall also define the corresponding
version without the
size parameter
. [
Note 3:
The default behavior above might change in the future,
which will require replacing both deallocation functions
when replacing the allocation function
. —
end note]
void operator delete(void* ptr, const std::nothrow_t&) noexcept;
void operator delete(void* ptr, std::align_val_t alignment, const std::nothrow_t&) noexcept;
Preconditions:
ptr is a null pointer or
its value represents the address of
a block of memory allocated by
an earlier call to a (possibly replaced)
operator new(std::size_t)
or
operator new(std::size_t, std::align_val_t)
which has not been invalidated by an intervening call to
operator delete. If the
alignment parameter is not present,
ptr was returned by an allocation function
without an
alignment parameter
. If present, the
alignment argument
is equal to the
alignment argument
passed to the allocation function that returned
ptr.Effects: The
deallocation functions (
[basic.stc.dynamic.deallocation])
called by the implementation
to render the value of
ptr invalid
when the constructor invoked from a nothrow
placement version of the
new-expression throws an exception
. Default behavior: Calls
operator delete(ptr),
or
operator delete(ptr, alignment),
respectively
.