Introduction
Implicit bugs in C++
()
Course structure
()
1. Implicit Copying
The FD class
()
You have a bug
()
Locating the bug
()
Exploring the implicit copy constructor
()
Implementing implicit copy
()
Disabling implicit copying
()
Move semantics
()
Assignment operators and copy-and-swap
()
2. Implicit Casts
Problem 1: Only prints once
()
Constructors as implicit casts
()
The explicit keyword
()
Problem 2: Corrupt file descriptor?
()
Explicit for casts
()
3. Undefined Behavior
Parameters order evaluation
()
Implementation of defined, unspecified, and undefined behavior
()
Null pointer dereference
()
Deconstructing null pointer example
()
Why UBs are a good thing (or not)
()
4. Exceptions and Destructors
The danger of a destructor throwing
()
Potential solutions
()
Conclusion
Philosophy of defensive class
()
Ex_Files_Avoiding_Implicit_Bugs_Cplusplus.zip
(1 KB)