- Introduction and overview
- Template arguments
- Concepts
- Function templates
- Parsing and compilation
- SFINAE
- Specialization
- Explicit instantiation
- Tuples
- Type lists
- Type traits
- Variadic templates
🔗
- S.Golodetz. Functional programming using C++ templates (Part I) – Overload 81 (2007)
- S.Golodetz. Functional programming using C++ templates (Part II) – Overload 82 (2007)
❔
- Templates – C++ FAQ
🎥
- J.Hagins. Template metaprogramming: Practical application – CppCon (2021)
- H.Matthews. The C++ type system is your friend – ACCU (2017)
- W.E.Brown. Modern template metaprogramming: A compendium. Part I, Part II – CppCon (2014)
- A.Modell. C++ advanced topics in templates – Tech Talk (2014)
- M.Caisse. Introduction to modern C++ techniques. Part I, Part II – C++Now (2012)
📄
- B.Stroustrup. Parameterized types for C++ – Computing System 2, 55 (1989)
📖
- D.Vandevoorde, N.M.Josuttis, D.Gregor. C++ templates: The complete guide – Addison-Wesley (2017)
- A.Alexandrescu. Modern C++ design: Generic programming and design patterns applied – Addison-Wesley (2001)
🎥
- J.Gopel. Using modern C++ to eliminate virtual functions – CppCon (2022)
🔗
- J.Müller. Tricks with default template arguments (2020)
❔
- What is a nondeduced context? – Stack Overflow
🎥
- S.Meyers. Type deduction and why you care – CppCon (2014)
⚓
- Template argument deduction – C++ reference
🔗
- A.O’Dwyer. Beware CTAD on
reverse_iterator
(2022) - A.O’Dwyer. Thoughts on
-Wctad-maybe-unsupported
(2022) - R.Orr. CTAD – What is this new acronym all about? – Overload 143 (2019)
❔
- Is
std::make_move_iterator
redundant since C++17’s class template argument deduction? – Stack Overflow
🎥
- M.Clow. Class template argument deduction: History, how to ise it, and how to enable it for your classes – CppCon (2022)
- T.Doumler. Class template argument deduction in C++17 – CppCon (2018)
- T.Doumler. Class template argument deduction in C++17 – ACCU (2018)
- S.T.Lavavej. Class template argument deduction for everyone – CppCon (2018)
- Z.Yuan. Class template argument deduction: A new abstraction – CppCon (2017)
⚓
- M.Spertus, F.Vali, R.Smith. Template argument deduction for class templates – WG21/P0091
❔
- What are template deduction guides and when should we use them? – Stack Overflow
⚓
- Deduction for class templates – C++ reference
See also Concepts – The standard library and proposals.
🔗
- A.Krzemieński. Concepts – case studies (2021)
- A.Krzemieński. Semantic requirements in concepts (2020)
- A.Sutton. Defining concepts – Overload 131 (2016)
- A.Sutton. Introducing concepts – Overload 129 (2015)
❔
- How will concepts lite interact with universal references? – Stack Overflow
- Why does
same_as
concept check type equality twice? – Stack Overflow
🎥
- J.Garland. Using concepts: C++ design in a concept world. Part I, Part II – C++Now (2021)
- R.Barkan. Semantic sugar: Tips for effective template library APIs – C++Now (2021)
- H.Matthews. C++ concepts for developers – NDC (2019)
- R.Grimm. Concepts in C++20: Revolution or evolution – CppCon (2019)
- B.Stroustrup. Concepts: The future of generic programming (the future is here) – CppCon (2018)
⚓
- W.E.Brown.
enable_if
vs.requires
: A case study – WG21/P0552
❔
- Why is the
std::derived_from
concept implemented with an additional convertibility test that adds cv-qualifiers? – Stack Overflow
🔗
- A.Fertig. C++20 concepts applied – Safe bitmasks using scoped enums (2024)
🔗
- H.Sutter. Why not specialize function templates?
❔
- Necessity of forward-declaring template functions – Stack Overflow
🎥
- B.Saks. Back to basics: Function call resolution in C++ – CppCon (2024)
- W.E.Brown. C++ function templates: How do they really work? – C++ on Sea (2019)
- W.E.Brown. C++ function templates: How do they really work? – CppCon (2018)
❔
- Why do I get linker errors when I use template friends? – C++ FAQ
- Correct syntax for friend template function – Stack Overflow
🎥
- D.Saks. Making new friends – CppCon (2018)
🔗
❔
- Why do templates use the angle bracket syntax? – Stack Overflow
- How do compilers eliminate the need to write white spaces between closing angle brackets, when using template classes since C++ 11 standard? – Quora
⚓
- D.Vandevoorde. Right angle brackets – WG21/N1757
🔗
- C.DaCamara. Improving the state of debug performance in C++ (2022)
- A.O’Dwyer. Benchmarking Clang’s
-fbuiltin-std-forward
(2022) - D.Pallastrelli. Reduce compilation times with
extern template
(2019) - L.Dionne. Efficient parameter pack indexing (2015)
- A.Bergé. True story: Efficient packing (2015)
🎥
- J.Brown. Reducing template compilation overhead, using C++11, 14, 17, and 20 – CppCon (2019)
❔
- Using
extern template
with third-party header-only library – Stack Overflow
Names are resolved in two steps: first, non-dependent names are resolved at the time of template definition and, second, dependent names are resolved at the time of template instantiation.
🔗
- T.Gani et al. Two-phase name lookup support comes to MSVC – Microsoft C++ team blog (2017)
- Two-phase lookup in C++ templates (2014)
- E.Bendersky. Dependent name lookup for C++ templates (2012)
❔
⚓
- J.Wilkinson, J.Dehnert, M.Austern. A proposed new template compilation model – WG21/N0906
struct S { template<typename T> using type = T; }; template<class T> void foo() { typename T::template type<int> x; } foo<S>();
🔗
- H.Sutter. GotW #35: Typename
❔
- Why don’t I need to specify
typename
before a dependent type in C++20? – Stack Overflow - Where and why do I have to put the
template
andtypename
keywords? – Stack Overflow
🎥
- A.Stepanov. Efficient programming with components (part of Lec. 12) – A9 (2013)
"Substitution Failure Is Not An Error" – when substituting the explicitly specified or deduced type for the template parameter fails, the specialization is discarded from the overload set instead of causing a compile error.
🔗
- Substitution failure is not an error – Wikipedia
❔
- What exactly is the “immediate context” mentioned in the C++11 Standard for which SFINAE applies? – Stack Overflow
- What is “Expression SFINAE”? – Stack Overflow
- How does
std::void_t
work – Stack Overflow - SFINAE and partial class template specializations – Stack Overflow
- SFINAE examples? – Stack Overflow
⚓
- SFINAE – C++ reference
- P.Barber. Unit testing compilation failure – Overload 108 (2012)
🔗
- A.O’Dwyer. Don’t reopen namespace
std
(2021) - O.Wigley. Alternatives for partial template function specialisation – Overload 50 (2002)
❔
- Partial specialization of template class copy constructor – Stack Overflow
- A.O’Dwyer. Don’t explicitly instantiate
std
templates (2021)
🔗
- N.Deppe. Template metaprogramming. Part 3: Tuple iteration with recursion (2017)
- N.Deppe. Template metaprogramming. Part 4: Recursion free tuple iteration (2017)
🎥
- J.Brown. Reducing template compilation overhead, using C++11, 14, 17, and 20 – CppCon (2019)
- A.Modell. C++ advanced topics in templates – Tech Talk (2014)
🔗
- N.Deppe. Template metaprogramming. Part 2: Typelist (2017)
- J.Galowicz. Type lists (2016)
- J.Galowicz. Type list compile time performance (2016)
- J.Galowicz. Transformations between user input/output and type lists (2016)
📖
- Ch. 3: Typelists – A.Alexandrescu. Modern C++ design: Generic programming and design patterns applied (2001)
See also Type traits – The standard library and Boost.
🔗
- J.Müller. Trivially copyable does not mean trivially copy constructible (2021)
- J.Müller. Technique: Immediately-invoked function expression for metaprogramming (2020)
- N.Deppe. Template metaprogramming. Part 1 (2017)
- T.Frogley. An introduction to C++ traits – ACCU (2001)
- J.Maddock, S.Cleary. C++ type traits (mirror) – Dr. Dobb’s Journal (2000)
❔
- What are the 15 classifications of types in C++? – Stack Overflow
🎥
- J.Hagins. Template Metaprogramming: Type Traits. Part 1, Part 2 – CppCon (2020)
- A.O’Dwyer. The best type traits that C++ doesn’t have – C++Now (2018)
- H.Matthews. The C++ type system is your friend – ACCU (2017)
⚓
- C++ named requirements:
UnaryTypeTrait
– C++ reference - C++ named requirements:
BinaryTypeTrait
– C++ reference - C++ named requirements:
TransformationTrait
– C++ reference
🔗
- E.Bendersky. Variadic templates in C++ (2014)
❔
- Variadic template pack expansion – Stack Overflow
🎥
- M.Dominiak. “Variadic expansion in examples – CppCon (2016)
⚓
- B.Seymour, S.T.Lavavej. Searching for types in parameter packs – WG21/N4115
🔗
- J.Müller. Nifty fold expression tricks (2020)
- A.O’Dwyer. Folding over
operator=
(2020)
⚓
- Fold expression – C++ reference