Advanced Template Programming in C++

Course objectives

After completing this course you will be able to:

  • use generic programming techniques in C++
  • use templates to write code that is fast, secure and reusable
  • implement classic generic programming techniques: tag dispatching, SFINAE, CRTP
  • use templates when designing classes: Policy Based Design
  • implement modern templates using constraints and concepts

Course syllabus

Templates

  • Function templates
  • Class templates
  • Template arguments
  • Template argument deduction
  • Explicit and partial specialization
  • Compilation model
  • Template aliases
  • Variable templates
  • Generic lambdas C++14

Variadic templates

  • Variadic template functions
  • Variadic template classes
  • Applying Head-Tail idiom for variadic templates
  • Variadic template types
    • std::tuple
    • std::variant
  • Fold expressions

Generic programming techniques

  • Templates and perfect forwarding
  • Metafunctions and type traits
  • Tag dispatching
  • SFINAE & enable_if<T>
  • Traits and Policies
    • Policy based design
  • CRTP idiom
  • Index sequences
  • Type erasure - concept based polymorphism

Templates in C++20

  • Concepts
  • NTTP – non-type template parameters
  • Templated lambdas in C++2

Prerequisites

Attendance of our Programming in C++ course or equivalent experience with C++

Course duration

3 days, 8 class hours each
On-site course quote

In-house training course.

Run at your company premises.

Get a quote
On-line course quote

In-house training course.

Delivered live in a virtual classroom.

Get a quote
Upcoming public courses
September 8 - 10, 2025 3490 PLN Enrol

Other dates?

Enquire now