Memory management library

Smart pointers, allocators and PMR, raw memory algorithms, operator new/delete, and lifetime-oriented utilities.

The C++ memory area spans ownership models, allocation strategies, polymorphic memory resources, raw storage algorithms, low-level pointer utilities, and the language-adjacent rules around object lifetime. This hub is the curated starting point when the problem is about how objects are stored, owned, created, destroyed, or allocated.

This page is a navigation hub. It points to canonical smart-pointer, allocator, PMR, raw-memory, and `new`/`delete` routes without duplicating their member inventories or absorbing adjacent container and utility documentation.

# Start Here

Exclusive ownership

Use unique_ptr when one owner controls an object or array and transfer-by-move is the intended ownership model.

Shared ownership

Use shared ownership when multiple parts of a program intentionally co-own an object and lifetime ends with the last owner.

Allocators and PMR

Start here when allocation strategy matters more than pointer ownership, especially for containers, arenas, and custom memory-resource wiring.

Raw storage and object lifetime

Use this route when the question is about `operator new/delete`, uninitialized storage, constructing into raw memory, or starting object lifetime explicitly.

# Quick Map

If you need to...Start withWhy
Own an object with a single clear ownerunique_ptrIt expresses exclusive ownership directly and is the default RAII pointer for heap objects that do not require shared lifetime.
Share ownership across multiple objects or callbacksshared_ptr, weak_ptrThese types model shared control blocks and non-owning observers for graph-like lifetime structures.
Customize allocation for containers or object constructionallocator, allocator_traits, polymorphic_allocatorUse the allocator path when the issue is allocation policy, propagation, fancy pointers, or container integration.
Use arena-like or shared memory resourcesmemory_resource, monotonic_buffer_resource, synchronized_pool_resourcePMR is the standardized route for runtime-selectable allocation backends.
Allocate raw storage and construct objects manuallynew/delete, construct_at, destroy, uninitialized algorithmsThis is the route for low-level object placement and lifetime control in buffers that do not yet hold live objects.
Recover raw addresses from fancy pointers or contiguous handlesto_address, pointer_traitsThese helpers bridge pointer-like abstractions with raw-address-based low-level code.
Reach the C allocation surfaceC memory management, C documentationUse this route when the code is intentionally using `malloc`/`free`-style APIs or interoperating with C allocation rules.

# Raw Memory And Lifetime Helpers

HelperUse it forPrimary destinations
Object construction and destructionExplicitly creating and tearing down objects in already-allocated storage.construct_at, destroy, destroy_at
Uninitialized algorithmsCopying, moving, filling, or default-constructing across raw storage ranges.uninitialized_copy, uninitialized_fill, uninitialized_default_construct
Lifetime start utilitiesBeginning object lifetime in storage without the classic placement-new model alone.start_lifetime_as
Address and alignment helpersWorking with fancy pointers, raw addresses, alignment contracts, and address recovery.to_address, addressof, align, assume_aligned

# Modern Additions

StandardWhat changed navigation-wise
C++11unique_ptr, shared_ptr, weak_ptr, allocator traits, and the new allocation/lifetime model became the dominant modern memory story.
C++17PMR introduced a second major allocation path centered on memory_resource and polymorphic_allocator.
C++20construct_at, to_address, and ranges-aware/lifetime-adjacent helpers made raw-memory code more explicit and more reusable.
C++23start_lifetime_as, out_ptr/inout_ptr, and allocator refinements expanded the interoperability and lifetime-control surface.
C++26New alignment and allocation-result helpers continue broadening the low-level memory toolset beyond classic smart-pointer navigation.

# Boundary Lines

This hub coversUse a different hub for
Ownership, allocation strategies, raw storage algorithms, and lifetime-oriented memory helpers.Containers for container selection and access models, Utility for general-purpose support types, and Type support for traits/limits not primarily about storage or ownership.
C++ memory-management abstractions.C memory when you need the plain C allocation family or cross-language allocation guidance.