~/talk

Great C++ is_trivial

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

Defines exactly which type traits let the compiler elide work and shows concrete assembly and compiler behaviors: ints and trivial aggregates compile to identical code while std::string forces nontrivial moves/copies, structured bindings defeat some RVO cases, and compilers still emit std::move calls in unoptimized builds. Builds a fixed-capacity constexpr container to prove many types can be made trivially copyable and demonstrates when return value optimization and implicit moves do or do not apply, and which classes (polymorphic or resource-managing) cannot be trivial.

AI-written summary · about

  1. 0:00Introduction and speaker intro
  2. 1:35Defining great C++ code
  3. 3:02Return value optimization exercise
  4. 9:57Out parameters vs return values
  5. 16:50Understanding trivial destructibility
  6. 19:41Trivially copyable types explained
  7. 22:39Trivial constructibility deep dive
  8. 27:53What makes a trivial type
  9. 30:07Efficiency of trivial types
  10. 33:38Structured bindings and triviality
  11. 35:05Pass by value vs pass by move
  12. 37:02Out parameters and undefined behavior
  13. 41:03Assignment vs initialization optimized
  14. 42:50When triviality depends on type
  15. 44:45What cannot be trivial
  16. 46:06Making containers trivial
  17. 51:23Rule of zero and triviality
~/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.