8.1. Global new and delete
The global versions of operator new and operator delete in the standard C++ library provide a uniform interface for allocating and deallocating objects of any type (built-in or class type). Table 8.1 shows the calling formats and signatures for global new.
Call Format | Signatures |
---|---|
new Type (predeclared) | void *operator new(size_t) throw(bad_alloc); |
new(nothrow) Type | void *operator new(size_t, const nothrow_t &) throw(); |
new (loc) Type | void *operator new(size_t, void *) throw(); |
new Type[size1][sizeN] (predeclared) | void *operator new[](size_t) throw(bad_alloc); |
new(nothrow) Type[size1][sizeN] | void *operator new[](size_t, const nothrow_t &) throw(); |
new (loc) Type[size1][sizeN] | void *operator ... |
Get Navigating C++ and Object-Oriented Design now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.