正常
OnceCallback: Callback Design Lessons from Chromium
This directory systematically covers the design of modern C++ callback systems by implementing a Chromium-style OnceCallback component. The content is divided into two learning paths:
Complete Beginner Tutorial (full/)
Tailored for readers with no prior experience, starting with a review of fundamental C++ features and gradually guiding them to a complete component implementation.
Prerequisites (7 chapters):
OnceCallback Prerequisites Quick Reference: Review of C++11/14/17 Core FeaturesOnceCallback Prerequisites (Part 1): Function Types and Template Partial SpecializationOnceCallback Prerequisites (Part 2): std::invoke and the Unified Callable ProtocolOnceCallback Prerequisites (Part 3): Advanced Lambda FeaturesOnceCallback Prerequisites (Part 4): Concepts and requires ConstraintsOnceCallback Prerequisites (Part 5): std::move_only_function (C++23)OnceCallback Prerequisites (Part 6): Deducing this (C++23)
Hands-on Practice (6 chapters):
OnceCallback in Practice (Part 1): Motivation and API DesignOnceCallback in Practice (Part 2): Building the Core SkeletonOnceCallback in Practice (Part 3): Implementing bind_onceOnceCallback in Practice (Part 4): Cancellation Token DesignOnceCallback in Practice (Part 5): then Chaining CompositionOnceCallback in Practice (Part 6): Testing and Performance Comparison
Advanced Design Guide (hands_on/)
Tailored for readers experienced with C++ templates, providing a quick walkthrough of the design motivation, implementation strategies, and test verification.