Abekus — AI learning and job matching platform logo

C++ Templates & Advanced

  • 144 lessons
  • About 16 hours
  • Self-paced
  • Free
  • Certificate on completion
0%Complete
Guided Mode

Start with lesson 1

144 lessons. The first one is free, no signup needed.

🗺️ Your learning path
Template Compilation Model
Template Parameter Types

What you'll learn

  • Read the template compilation model from first principles — two-phase name lookup, instantiation at use, the difference between declaration and definition visibility — and explain why templates live in headers.
  • Trace template type deduction across function templates, class templates, and the C++17 CTAD rules with deduction guides — and predict the deduced type for any call site.
  • Apply template specialization deliberately — full specialization for fixed types, partial specialization for pattern matching on type shape, and the specialization-vs-overloading trade-off.
  • Use variadic templates fluently — parameter packs, recursive expansion, the sizeof... operator, and fold expressions (C++17) for compile-time aggregations over the pack.
  • Apply SFINAE in idiomatic forms — enable_if-based constraints, std::void_t and the detection idiom, the trade-off against C++20 concepts — and recognise where it gates compile-time overload resolution.
  • Use C++20 concepts — concept definitions, requires expressions, concept-constrained templates, and the readability and error-message wins over SFINAE.
  • Apply CRTP (the Curiously Recurring Template Pattern) — static polymorphism, mixin chains, and the trade-offs against runtime polymorphism (vtables) for performance-sensitive code.
  • Use policy-based design — policy classes, traits classes, template template parameters — and the modular library-design technique that powers std::allocator and similar STL machinery.
  • Reason about template metaprogramming — compile-time computation with constexpr and constexpr-if, type lists and type-list operations, metafunction patterns for type transformation.
  • Recognise advanced template idioms — expression templates for fluent DSLs, tag dispatch for compile-time function selection, and the senior-engineer techniques behind STL-grade libraries.
  • Make template-design decisions under interview and library-design pressure — concept comparisons (SFINAE vs concepts; specialization vs overloading; CRTP vs virtual), pattern selection, and templates in real production code.

About this course

C++ Templates & Advanced is a free practice course on Abekus built around 1,400+ MCQs covering the template machinery that makes C++ a library-author's language — template type deduction, full and partial specialization, variadic templates with parameter packs and fold expressions, SFINAE and type traits, C++20 concepts, the Curiously Recurring Template Pattern (CRTP), policy-based design, template metaprogramming, and the advanced idioms (expression templates, tag dispatch) behind STL-grade libraries.

The format is one question at a time with an explanation that fires the moment you click a wrong answer. No videos, no skimming standard-ese — retrieval practice on the deduction, instantiation, and overload-resolution scenarios that trip up senior C++ candidates and library authors. You will trace what type the compiler deduces for an awkward call site, predict whether a SFINAE constraint kicks in, and recognise when a CRTP base class is the right shape for a problem.

Learning path

C++ Mastery

A complete C++ learning track on Abekus — from language fundamentals through modern C++11/14/17/20/23 features, the STL, and template metaprogramming. Free MCQ practice with instant explanations, designed as a progression: each course builds on the one before.

4 courses·6,050 practice MCQs·84.5h of content

Frequently asked questions