~/talk

Allocator-Aware C++ Type Design

Talkat C++ on Sea 2024 · 2024-07-02..07-05· [c-and-cpp]
links:none on file
slides:none on file

Adds allocator support to a simple DynamicOptional as a worked reference implementation: allocator becomes a second template parameter defaulting to std::allocator<T>, constructors accept std::allocator_arg_t overloads, and code uses allocator_traits (pointer typedef, allocate/construct/destroy/deallocate) plus select_on_container_copy_construction and the propagate_on_container_* traits to decide copy/move/swap behavior. Tests expose finicky edge cases—especially that swap is undefined if allocators don’t compare equal—so helpers for construct/destroy and careful allocator propagation are required for correct, portable behavior.

AI-written summary · about

  1. 0:00Introduction and motivation
  2. 2:44Implementing dyn_optional
  3. 6:16Understanding allocators
  4. 11:30Lego analogy for allocators
  5. 15:07Adding allocator support
  6. 31:52Closing and acknowledgments
~/search
type to search 6,249 conferences, 138,987 speakers and 185,172 talks
~/help
cmdctrl k
search every conference, speaker and series
/
focus the filter search
h
home
c
conferences
s
speakers
e
series
t
light / dark — the status bar button does the same
?
this help
esc
close this, then clear every filter — or just the search, while you are typing in it

Ignored while you are typing. Pages without a filter rail have no search to focus.