The hidden rules of world-class C++ code
summary
Claim: the familiar factory method can be reimplemented without heavy inheritance while keeping delegation, extensibility, reuse and runtime selection. Demonstrates working code (repo: https://github.com/BorisSchaeling/worldclasscode) and compiles examples that swap virtual dispatch for std::function and Boost.TypeErasure or for templates and factory functions, returning unique_ptr where needed. Shows when runtime polymorphism is necessary, when type erasure or free functions are clearer, and that the alternate implementations actually build and run, with tradeoffs in scope, clarity and performance measured by practical examples.
AI-written summary · about
chapters (18)
- 0:00The hidden rules of world-class C++ code
- 7:07What the Internets say
- 12:50Traditional implementation
- 15:37Modern C++ implementation
- 16:56How to do it with no design pattern
- 17:43Factory method pattern break down Meeting C++ 2017
- 24:51Global factory functions
- 30:13Factory methods
- 30:39Common interface
- 31:45Factory function objects
- 32:13Type erasure to the rescue
- 34:46Removing the Connection base class Meeting C++ 2017
- 41:23Removing the function objects
- 47:06What's so world-class about it?
- 51:49Separation of concerns
- 58:27Boost.Functional/Factory Meeting C++ 2017
- 58:48Type erasure by hand
- 59:19Boost Master class
related talks
01h 02mHow to Hide C++ Implementation Details
01h 02mRefactoring C++ Code for Unit testing with Dependency Injection
01h 11mPragmatic Simplicity - Actionable Guidelines To Tame Cpp Complexity
51mSimplicity: Not Just for Beginners
01h 03mModern C++ Development: Limitations and Problems in std::function and Similar Constructs
58mC++ Under the Hood: Internal Class Mechanisms
53mBack to Basics: Lifetime Management in Cpp
06mLightning Talk: Best Practices Every C++ Programmer Needs to Follow
