Back To Basics: The Special Member Functions
summary
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
chapters (25)
- 0:00Introduction
- 0:47Special Member Functions
- 3:24Default Constructor
- 8:28Empty Default Constructor
- 13:47Destructor
- 17:38Copy
- 24:19Copy Constructor
- 26:42Real Copy
- 28:31Cleanup
- 31:17Temporary Swap
- 33:45Copy Assignment
- 35:12Swap
- 36:24The Rule of 3
- 37:53Unique Pointer
- 40:20Rule of Zero
- 40:46Questions
- 43:55Apologies
- 44:30Signature
- 45:27Move
- 47:27Move Operations
- 53:50Semantics
- 54:37Summary
- 56:59The Rule of Zero
- 57:40The Rule of Five
- 59:52The Rule of Three
related talks
39mBack to Basics: The Rule of Five in C++
01h 02mBack to Basics: C++ Move Semantics
01h 06mThe Canonical Class
01h 10mAn Overview of C++11/14, Part II
01h 40mBack to the Basics! Essentials of Modern C++ Style
59mBack to Basics: Generic Programming in C++
49mBack to Basics: C++ Smart Pointers
04m(don't) Copy Paste All The Things
