Comparing 'Classic C++' and 'Modern C++' Ways to Solve Programming Tasks
summary
Compares concrete C++ idioms by showing code, compile behavior and measurements: multiple loop forms (index, reverse, iterator, range-for), using algorithms like std::accumulate vs ranges::fold_left (C++23, Microsoft runtime available), and testing performance with blind comparisons. Shows template constraints evolving from enable_if to concepts with clearer error messages, stream pitfalls (strstream leaks, std::ostringstream copies fixed by std::move and new spanstream in C++23 by Peter Summerland), structured bindings vs tuples, and prefers owning members to reach the rule of zero.
AI-written summary · about
chapters (32)
- 0:00Introduction
- 1:23History of C
- 3:31Lessons from C23
- 4:58For Loop
- 7:21Gotos
- 12:54Auto
- 15:32Reverse
- 18:22Multiply
- 20:04STL Iterator
- 23:09Generic Iterator
- 24:42AutoItem
- 26:36AutoRef
- 27:27Sean Parent
- 30:19Accumulation
- 33:45Summary
- 35:03constraining templates
- 36:43Vector events
- 37:43Standenableif
- 40:32Concepts
- 41:54Error Messages
- 42:33Using a Concept
- 43:53Advantages
- 45:38Streaming
- 46:38Logging
- 47:18StressStream
- 48:11InputStream
- 51:14OStringStream
- 54:14STDmove
- 56:14Fixed Buffer
- 57:27Span Stream
- 58:51I Span Stream
- 59:18I Span Stream Summary
related talks
01h 01mLearning (and teaching) modern C++ - Challenges and Resources
59mModern C++ for Fun and Profit: This isn’t your old C++
01h 02mC++20 - My Favourite Code Examples
01h 35mC++20 – My Favourite Code Examples
47mLearning (and teaching) modern C++ - Challenges and Resources
48mEarly Modern C++: How to Handle a C++03 Codebase in $CURRENT_YEAR
59mC++20 - My Favourite Code Examples
57mThe Real Problem of C++
