Overview
Explore the evolution of metaprogramming in C++ from templates to concepts in this comprehensive conference talk from CppNow 2023. Dive into the history of C++ metaprogramming techniques, starting with C++11-17 approaches and progressing to the powerful features introduced in C++20, such as concepts. Learn how to implement metaprogramming examples using both older and modern C++ standards, demonstrating the increased clarity and elegance of code. Gain insights into complex traits, print functions, type dispatching, nested iterators, and concept libraries. Discover how to leverage concepts to create more expressive and readable metaprogramming code, addressing common challenges and fears associated with template metaprogramming. Ideal for C++ developers looking to enhance their metaprogramming skills and modernize their codebase.
Syllabus
Introduction
Templates
CPP
Code
What we will do
Trades
Complex Traits
Print Function
Print Helper
aliasing
type dispatching
Auto parameter to function
Nested iterator
Substitution
Container
Enable
Print
Fold
Concepts
Containers
Dark Territories
Void
Problems
People are afraid
The interesting part
Concept Library
Concept in C
The problem
The solution
Template is ignored
Constrating variables
Name concept
Conjunctions
Atomic constraint
Primary Expressions
Required Expressions
Example
Type Check
Using Concepts
Taught by
CppNow