The library provides default definitions for the global allocation and
deallocation functions
. The following allocation and deallocation functions (
[support.dynamic])
are implicitly declared in global scope in each translation unit of a
program
.void* operator new(std::size_t);
void* operator new(std::size_t, std::align_val_t);
void operator delete(void*) noexcept;
void operator delete(void*, std::size_t) noexcept;
void operator delete(void*, std::align_val_t) noexcept;
void operator delete(void*, std::size_t, std::align_val_t) noexcept;
void* operator new[](std::size_t);
void* operator new[](std::size_t, std::align_val_t);
void operator delete[](void*) noexcept;
void operator delete[](void*, std::size_t) noexcept;
void operator delete[](void*, std::align_val_t) noexcept;
void operator delete[](void*, std::size_t, std::align_val_t) noexcept;
These implicit declarations introduce only the function names
operator new,
operator new[],
operator delete, and
operator delete[]. [
Note 2:
The implicit declarations do not introduce
the names
std,
std::size_t,
std::align_val_t,
or any other names that the library uses to
declare these names
. —
end note]
Allocation and/or
deallocation functions may also be declared and defined for any
class (
[class.free])
.