P2719R6 — Type-aware allocation and deallocation functions
Louis Dionne, Oliver Hunt, Vlad Serebrennikov
CWG
Revisions R7Jul 2026R6Jul 2026
C++ currently provides two ways of customizing the creation of objects in new expressions. First, `operator new` can be provided as a static member function of a class, like `void* T::operator new`. If such a declaration is provided, an expression like `new T(...)` will use that allocation function. Otherwise, the global version of `operator new` can be replaced by users in a type-agnostic way, by implementing `void* operator new(size_t)` and its variants. A similar mechanism exists for *delete-expressions*.