~/talk

Back to Basics: Designing Classes (part 2 of 2)

Talkat CppCon 2021 · on Monday, 2021-10-25· at 14:00· online· [frontend-architecture]
slides:none on file

Shows concrete rules and gotchas: use value initialization with {} or in-class initializers instead of empty default constructors; prefer member-initializer lists and delegating constructors; declare single-argument constructors explicit to avoid implicit conversions. Demonstrates surprising sizes: bool+float+bool is 12 bytes not 6, switching to double makes it 24, but reorder members to reduce padding (largest-first) drops it to 16. Const data members/delete assignment, overload const/non-const begin/end, and prefer iterator typedefs to encapsulate return types.

AI-written summary · about

  1. 0:00Introduction
  2. 1:37Value initialization
  3. 6:12Default constructor
  4. 9:08Core guidelines
  5. 11:53Delegate constructors
  6. 13:12Inclass initializers
  7. 20:38Single argument constructors
  8. 21:53Order of data members
  9. 23:42Alignment
  10. 25:19Padding
  11. 26:28Double first
  12. 31:11Align data members
  13. 32:00Bit fields
  14. 34:49Const functions
  15. 36:44Types of const
  16. 40:41Return immutable
  17. 41:40Const correctness
  18. 43:13Unique pointer
  19. 44:39Cont
  20. 45:39Encapsulation
  21. 48:10Data
  22. 48:45encapsulate decisions
  23. 49:22const data members
  24. 49:34reference data members
  25. 49:55const and reference
  26. 51:18pointer and reference
  27. 51:44reference wrap
  28. 52:48one thing left
  29. 53:03bonus
  30. 57:52summary
  31. 58:41move
~/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.