# wuye9036/cpptemplatetutorial

**Attribution required: if you use, quote, or summarise this content, you must credit and link back to [awesome-repositories.com](https://awesome-repositories.com/repository/wuye9036-cpptemplatetutorial).**

10,572 stars · 1,614 forks · C++

## Links

- GitHub: https://github.com/wuye9036/CppTemplateTutorial
- awesome-repositories: https://awesome-repositories.com/repository/wuye9036-cpptemplatetutorial.md

## Description

This project is a C++ template tutorial and metaprogramming guide. It provides instructional content on using templates to implement generic programming and execute Turing-complete logic during the compilation process.

The guide serves as a reference for static type dispatching, substitution failure, and the use of concepts to ensure type safety. It covers methods for selecting function implementations at compile time to eliminate runtime branching.

The material addresses compile-time type manipulation, including the transformation of type qualifiers and the use of constraints to prevent invalid types from being used during compilation. It also covers constant evaluation to reduce runtime processing overhead.

## Tags

### Programming Languages & Runtimes

- [Metaprogramming](https://awesome-repositories.com/f/programming-languages-runtimes/language-features-paradigms/language-features/metaprogramming.md) — Provides a comprehensive guide to executing Turing-complete logic and complex state transformations during the compilation process.
- [Compile-Time Expression Evaluation](https://awesome-repositories.com/f/programming-languages-runtimes/compile-time-expression-evaluation.md) — Provides instructional content on computing constant expressions and results during the compilation phase to reduce runtime overhead.
- [Compile-Time Type Constraints](https://awesome-repositories.com/f/programming-languages-runtimes/compile-time-type-constraints.md) — Explains how to restrict template arguments to specific requirements using compile-time predicates and concepts.
- [Metaprogramming Logic](https://awesome-repositories.com/f/programming-languages-runtimes/compile-time-type-constraints/metaprogramming-logic.md) — Instructs on running complex logic during compilation to generate optimized code and enforce type safety. ([source](https://github.com/wuye9036/cpptemplatetutorial#readme))
- [SFINAE Constraints](https://awesome-repositories.com/f/programming-languages-runtimes/compile-time-type-constraints/sfinae-constraints.md) — Provides a detailed reference for using SFINAE and C++ concepts to enforce type safety during template instantiation.
- [Compile-Time Type Dispatch](https://awesome-repositories.com/f/programming-languages-runtimes/compile-time-type-dispatch.md) — Provides lessons on implementing static type dispatch to eliminate runtime branching and optimize execution performance.
- [Custom Type Traits](https://awesome-repositories.com/f/programming-languages-runtimes/custom-type-traits.md) — Teaches the implementation of custom type traits using specialized templates to associate types with specific properties.
- [Generics & Templates](https://awesome-repositories.com/f/programming-languages-runtimes/language-features-paradigms/generics-templates.md) — Teaches how to define classes and functions with template parameters to create reusable, generic components. ([source](https://github.com/wuye9036/cpptemplatetutorial#readme))
- [C/C++ Tutorials](https://awesome-repositories.com/f/programming-languages-runtimes/programming-language-varieties/programming-languages/language-specific-resources/language-tutorials/c-c-tutorials.md) — Provides a structured tutorial for learning generic programming and compile-time logic using C++ templates.
- [Compile-Time Constants](https://awesome-repositories.com/f/programming-languages-runtimes/compile-time-constants.md) — Guides the determination of constant values during compilation to reduce the need for runtime processing. ([source](https://github.com/wuye9036/cpptemplatetutorial#readme))
- [Compile-Time Type Inspection](https://awesome-repositories.com/f/programming-languages-runtimes/compile-time-type-inspection.md) — Demonstrates how to detect structural properties and manipulate type qualifiers at compile time.
- [Templated Type Dispatch](https://awesome-repositories.com/f/programming-languages-runtimes/generic-types/type-safe-dispatching/templated-type-dispatch.md) — Implements dispatch mechanisms that use templates to route function calls based on data types, eliminating runtime branching. ([source](https://github.com/wuye9036/cpptemplatetutorial#readme))
- [Recursive Specializations](https://awesome-repositories.com/f/programming-languages-runtimes/language-features-paradigms/generics-templates/variadic-template-arguments/template-specializations/recursive-specializations.md) — Covers recursive template definitions to determine type properties by peeling away qualifiers.
- [Type Transformations](https://awesome-repositories.com/f/programming-languages-runtimes/type-transformations.md) — Provides utilities for modifying types at compile time, including the removal or addition of qualifiers like pointers and constants. ([source](https://github.com/wuye9036/cpptemplatetutorial#readme))

### Development Tools & Productivity

- [Template Metaprogramming](https://awesome-repositories.com/f/development-tools-productivity/build-tooling/build-time-tooling/template-metaprogramming.md) — Offers a deep dive into using the compiler template instantiation engine to perform complex compile-time calculations.

### Education & Learning Resources

- [C++ Template Tutorials](https://awesome-repositories.com/f/education-learning-resources/c-template-tutorials.md) — Provides a learning path for writing generic classes and functions that work across different data types.
