Special Member Functions in C++
summary
Explains exactly when the compiler emits or suppresses constructors, destructor, copy and move ops: declaring any constructor disables the default ctor, declaring copy or move ops affects the others (moves fall back to copies when absent), and requesting default or delete still counts as user-declared; the move/copy pair must be implemented together. Covers about eight constructor forms, demonstrates CPPInsights and Compiler Explorer to inspect generated code, recommends using sanitizers and static analyzers and compile-time tests, and advocates the rule of zero and rule of five and RAII patterns like RAII for resource safety.
AI-written summary · about
chapters (17)
- 0:00Introduction
- 0:44Agenda
- 2:54About me
- 4:48Fundamentals
- 7:13Magic
- 8:40Compiler Errors
- 13:57Constructors
- 14:38Constructor Types
- 15:11Default Constructor
- 17:23Copy
- 18:09Composition Inheritance
- 21:13Declaration Rules
- 26:45Not declared vs Deleted
- 33:14Copy Behavior
- 36:03Rule of Zero
- 40:01All
- 43:12Constructor
related talks
03mRule of DesDeMovA
51mNew features in C++
01h 19mThis is C++: Uncompromised Performance, Undefined Behavior, & Move Semantics
43mC++: All the flavours of operators new and delete
01h 23mThis is C++ - How to Use the C++ Superpower to Write Better C++ Code
55mBack to Basics: Move Semantics (part 1 of 2)
01h 01mFunctional C++
54mTypical C++, But Why?
