~/talk

Back To Basics: The Special Member Functions

Talkat CppCon 2021 · on Wednesday, 2021-10-27· at 07:45· online· [rust]
slides:none on file

Covers the six special member functions (default ctor, dtor, copy/move ctor and assignment) with concrete rules when the compiler generates or omits them, what the default implementations actually do (member-wise copy/move, no cleanup of raw pointers), and common surprises: value vs default initialization, noexcept from =default, self-assignment bugs, and when move is suppressed. Shows fixes and tools: Rule of 0, use of unique_ptr/shared_ptr, the temporary swap idiom and using =default / =delete to express intent.

AI-written summary · about

  1. 0:00Introduction
  2. 0:47Special Member Functions
  3. 3:24Default Constructor
  4. 8:28Empty Default Constructor
  5. 13:47Destructor
  6. 17:38Copy
  7. 24:19Copy Constructor
  8. 26:42Real Copy
  9. 28:31Cleanup
  10. 31:17Temporary Swap
  11. 33:45Copy Assignment
  12. 35:12Swap
  13. 36:24The Rule of 3
  14. 37:53Unique Pointer
  15. 40:20Rule of Zero
  16. 40:46Questions
  17. 43:55Apologies
  18. 44:30Signature
  19. 45:27Move
  20. 47:27Move Operations
  21. 53:50Semantics
  22. 54:37Summary
  23. 56:59The Rule of Zero
  24. 57:40The Rule of Five
  25. 59:52The Rule of Three
~/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.