正常
Template Basics (C++11-14)
C++ templates are the core mechanism of generic programming. This part moves from "using templates" to "writing libraries, reading STL source," covering the compilation model, specialization and partial specialization, non-type parameters, two-phase name lookup, hidden friends, alias templates, and CRTP, finally welding the first nine pieces together with a fixed_vector<T, N> project.
Runnable examples live in code/examples/vol4/vol1-basics-cpp11-14/: the four most reusable ones (fixed_vector, CRTP static polymorphism, the Comparable mixin, and type_traits from scratch), each compiles with g++ -std=c++20 xxx.cpp.
Templates, From Scratch: A Code Recipe with PlaceholdersFunction Templates, In Depth: Compilation Model and the No-Partial-Specialization TrapClass Templates: Members, Dependent Names, and Lazy InstantiationTemplate Specialization and Partial Specialization: The Art of Pattern MatchingNon-Type Template Parameters: From Integers to C++20 Floats and Class TypesName Lookup and ADL: How Two-Phase Lookup WorksTemplate Friends and Barton-Nackman: The Hidden Friends TrickAlias Templates and using Declarations: Short Names for TypesCRTP: Static Polymorphism with the Curiously Recurring Template PatternProject: fixed_vector