P2719

Type-aware allocation and deallocation functions

R8

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*.

Authors
Louis Dionne, Oliver Hunt, Vlad Serebrennikov
Mailing
2026-09
Doc date
2026-07-09
Audience
CWG

Revision history

  1. 2026-09
    R8 Selected (shown above)
  2. 2026-07
    R7 CWG

    Type-aware allocation and deallocation functions

  3. 2026-07
    R6 CWG

    Type-aware allocation and deallocation functions