Back to the Basics! Essentials of Modern C++ Style
summary
Revisits concrete rules: default to auto by default for locals, prefer range-for with auto& for whole-collection loops, and use make_unique/make_shared instead of new/delete; prefer non-owning raw pointers/references for parameters and return values. Gives numbers: about 3 million C++ users, ~30 libstdc++ contributors, ~5–7 libc++ contributors, and a reported 4x RocksDB speedup after changing shared_ptr calls. Exposes the shared_ptr reentrancy pitfall and prescribes pin a local shared_ptr copy as the cure.
AI-written summary · about
chapters (20)
- 0:00Introduction
- 1:00Resisting complexity
- 5:57Simple defaults
- 9:11Range-based loops
- 12:09Modern smart pointers
- 16:43Lifetime management
- 23:20Safe pointer dereferencing
- 28:27Using auto
- 34:18Deduction benefits
- 38:53Left-to-right style
- 45:01Auto corner cases
- 51:08Move semantics
- 55:15Parameter passing
- 59:04Advanced optimizations
- 1:03:40Pass by value issues
- 1:10:21Efficient setters
- 1:14:07Forwarding references
- 1:17:47Multiple return values
- 1:23:18Conclusion and Q&A
- 1:35:06Final Q&A
related talks
49mBack to Basics: C++ Smart Pointers
01h 03mBack to Basics: The C++ Core Guidelines
39mBack to Basics: The Rule of Five in C++
01h 30m50 shades of C++
01h 03mLearning and teaching modern C++
50mBack to Basics: Smart Pointers and RAII
01h 01mBack to Basics: C++ API Design
58mUnderstanding and Mastering C++'s Complexity
