Allocator awareness

allocator_traits, PMR, arenas, allocate_at_least.

allocator_traits makes minimal custom allocators viable (defaults fill in the boilerplate); alignas handles alignment. Still template-parameter-infects-the-type.

template <class T>
struct ArenaAlloc {
  using value_type = T;
  T* allocate(std::size_t n);
  void deallocate(T*, std::size_t);
};

No change; sized deallocation arrives as an optimization hook for global operator delete.

PMR: memory_resource, polymorphic_allocator, and ready-made monotonic_buffer_resource / pool resources — allocation strategy becomes a runtime value, and pmr::vector<T> is one type regardless of arena.

std::byte buf[4096];
std::pmr::monotonic_buffer_resource arena(buf, sizeof buf);
std::pmr::vector<Token> toks(&arena);   // all nodes from the stack buffer

Constexpr allocation lets containers run at compile time; make_shared supports arrays; destroying operator delete enables custom layout tricks.

allocate_at_least exposes the real capacity an allocator hands back, ending the lie where vector asks for n and wastes the slack the allocator gave anyway.

std::indirect/std::polymorphic are allocator-aware from day one, extending PMR discipline to value-semantic heap members; inplace_vector covers the no-allocator-at-all case.

C++29direction · not adopted

Direction: allocator interop with relocation and async (sender environments carrying allocators) is where the discussion lives.

C++26 per the final working draft; C++29 rows are proposals and direction, not adopted features.