~/talk

How to Hold a T

Talkat CppCon 2019 · 2019-09-15..09-20· [c-and-cpp, software-architecture]
links:none on file
slides:none on file

Containers separate allocation and construction: T is the wrong type to hold a T, so use an unrelated storage type (char buffer or a union) and manually control lifetime with placement new and an explicit destructor. Practical claim: union storage gives correct size/alignment and supports multi-dimensional layouts, but non-trivial members require a user-written ctor/dtor and the container must handle exception safety. Warning: aligned_storage is UB and is fragile; real std::vector/optional implementations use these techniques and they work.

AI-written summary · about

  1. 0:00Intro
  2. 4:07Implementation
  3. 10:57Opinion
  4. 15:36Unions
  5. 16:49Decouple
~/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.