Typical Type Typos
summary
Covers concrete C++ pitfalls with code examples: range-based for on a std::map copies because elements are pair<const K,V>, returning a reference to a temporary default argument produces a dangling reference from default arg, vector<bool> yields a vector<bool> proxy that needs forwarding references, missing noexcept on move causes std::vector to copy instead of move, and returning a moved element after pop_back uses an invalidated reference unless moved before popping; assumes knowledge of rvalue references and smart pointers.
AI-written summary · about
chapters (11)
- 0:00Start
- 3:44Compiler Warnings
- 6:09What Is the Problem with this Piece of Code
- 26:31Specialization and Inheritance
- 29:22Value and Move Semantics
- 53:13Const Iterators
- 55:35What Can Go Wrong
- 1:02:25Dangling Reference Returned from Ptr
- 1:16:29Why Struct Is Not a Strong Type
- 1:24:31What Is the Problem with the Current Implementation
- 1:30:25Redundant Copying
related talks
01h 31mLearning from C++ Juniors’ Mistakes
58mA Practical Guide to Loose Coupling
56mWill Your C++ Program Still Be Correct Next Year?
01h 12mWriting robust code
01h 09mLocknote: Local Reasoning in C++
06mMocking C++
59mC++ Unit testing - the good, the bad & the ugly
05mSo you want to test your templated code? I know your type
