C++ Template Techniques

idiomatic use of templates

1.0 Concept

TemplateTechniques demonstrates the syntax and concepts required for implementing template classes. The repository includes basic examples as well as the use of template specialization and template template parameters.

2.0 Design

TemplateTechniques contains six folders:
  • Templates
    Basic examples of template functions and classes.
  • TemplateTechniques
    Examples of syntax including template specialization and template template parameters.
  • TemplateFunctorsEtc
    Illustrates the use of functors with Standard Template Library (STL) containers.
  • TemplateMetaProgramming
    Provides some examples showing that C++ compilers implement a functional language that executes at compile time.
  • VariaticTemplates
    Uses compile-time recursion to create templates that accept any number of template parameters.
  • CustomContainerTypeTraits
    Uses variatic templates to form composite traits for specializing template classes and overloading template functions.

3.0 Implementation

Find C++ source code in TemplateTechniques repository.
TemplateTechniques code was built with Visual Studio Community Edition - 2019 and tested on Windows 10. It was compiled with the C++17 option set in Properties > C/C++ > language.

4.0 Status

TemplateTechniques folder has several projects that will be removed. They cause more confusion than insight.