Delegate this! Designing with delegates in modern C++
summary
Showcases a header-only delegate implementation that matches C function pointer speed and interoperates with std::function, used to wire IncludeOS’s IP stack top-to-bottom with header-only delegates as fast as C function pointers and to build routing, REST endpoints and unit tests. Delegates carry state-less signatures, move unique_ptr packet buffers, and allow rewire protocol handlers at runtime without context switches. The system runs single-threaded, sustains a few gigabits and tens of thousands of concurrent connections, and exposes messy async loops for complex bidirectional transfers.
AI-written summary · about
chapters (16)
- 0:00Introduction to delegates
- 3:54Finding fast delegates
- 6:42Basic usage and lambdas
- 9:11Neural network example
- 13:42Runtime rewiring
- 16:49Delegates vs std::bind
- 18:40Neural network complexity
- 19:53IP stack architecture
- 22:17Async callback performance
- 28:31Asynchronous loops
- 31:14Real brain comparison
- 33:48Alternatives and libraries
- 35:33Unit testing with mocks
- 37:21Practical web service
- 40:12Implementing a firewall
- 47:13Q&A and conclusion
related talks
01h 16mPolymorphism, Cohesion, and Coupling in C++
01h 07mDesign Patterns in Modern C++
01h 28mModern C++ Design reloaded
05mConcept Driven Design with Dependency Injection
49mPolymorphism != Virtual: Easy, Flexible Runtime Polymorphism Without Inheritance
01h 01mEasy to Use, Hard to Misuse: Declarative Style in C++
46mPractical Functional Programming in C++
01h 02mAdvanced Levelization Techniques (part 2 of 3)
