Unit 01 of 02
Classes and Resources
Where C and C++ diverge, access control, constructors and destructors, RAII, deep and shallow copies, references and operator overloading — each paired with the question of which object an expression works with.
Published Updated
Lessons
- 01 C and C++ Differences Introduces the course's four measurement kinds with a core run that measures which object a struct passed by value in C works with in C++. 13 min read
- 02 Classes and Access Control Measures which object a member function works with, and that access control operates at the level of the class, not the object. 4 min read
- 03 Constructors and Destructors Measures that an argument implicitly built from an int is an unnamed, temporary object, and measures its lifetime with a constructor/destructor pair. 13 min read
- 04 RAII Measures that the member a guard acquires and releases is a part inside the guard object, not the guard itself. 12 min read
- 05 Copying and Assignment Measures that the copy constructor and copy assignment operator produce a deep copy that takes its own array, and that the depth of the copy depends on the design of the class. 13 min read
- 06 References Measures that a reference parameter works with the caller's own object, producing no copy at all. 12 min read
- 07 Operator Overloading Measures why operator+ returns a new temporary object, and why operator+= instead returns its own object by reference. 2 min read