~/talk

Back to Basics: Cpp Value Semantics

Talkat CppCon 2022 · 2022-09-11..09-16· [rust]
slides:none on file

Argues for preferring value semantics over reference semantics, replacing pointer-and-inheritance visitor code with a std::variant-based vector of values, std::function for callables, and std::optional for fallible results; demonstrates a benchmark (10,000 random shapes) where variant beats the classic visitor by quite a margin, shows span causing undefined behavior after vector reallocation, and notes simpler code, fewer allocations, and better memory locality no virtual functions no lifetime juggling.

AI-written summary · about

  1. 0:00Introduction
  2. 4:24Structure
  3. 8:16Disadvantages
  4. 10:05Value Semantics
  5. 14:47Advantages
  6. 26:05Remove function
  7. 29:13Standard Library
  8. 34:11Optional
  9. 42:22Memory usage
  10. 43:52Variants
~/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.