C++: All the flavours of operators new and delete
summary
C++20 defines 22 flavours of operator new and 30 versions of operator delete and the talk enumerates exact cases: throwing vs nothrow, single-object vs array, placement forms, class-specific overrides and aligned variants. It shows that global overrides are always chosen by make_unique, placement new with void* is non-overridable, class destroying delete is preferred, and aligned delete requires matching alignment and explicit destruction unless the right overload is called — demos expose surprising resolution and lookup quirks.
AI-written summary · about
chapters (12)
- 0:00Introduction
- 2:20Flavors of new and delete
- 4:05Allocation functions basics
- 10:11Default and value initialization
- 13:00Placement operators
- 17:57Overriding operators new and delete
- 24:11Global vs class-specific overrides
- 26:43Placement operator limitations
- 29:15Smart pointers and allocation
- 32:48Aligned allocation functions
- 36:01Alignment operator examples
- 41:28PMR and closing
related talks
01h 19mSpecial Member Functions in C++
01h 28mEmbracing the **noexcept** Operator and Specifier *Safely*
01h 19mThis is C++: Uncompromised Performance, Undefined Behavior, & Move Semantics
51mC++ Features You Might Not Know
01h 04mA Preview of C++ 23
01h 02mC++20 - My Favourite Code Examples
53mC++ Features You Might Not Know
59mC++20 - My Favourite Code Examples
