C++ Essentials: Templates
Published by O'Reilly Media, Inc.
Write efficient, flexible, and maintainable software
C++ templates have proven to be one of the most powerful but also one of the most challenging features of the language, particularly for C++ beginners.
Join expert Klaus Iglberger for a hands-on introduction to C++ templates and learn how to wield this useful, time-saving tool. You’ll get acquainted with C++ syntax, implementation details, instantiation, and full and partial specialization, and you’ll have a go writing your own basic, specialized, and advanced templates so your software is more efficient, flexible, and maintainable.
What you’ll learn and how you can apply it
By the end of this live online course, you’ll understand:
- Why C++ templates are considered a powerful feature
- When to use templates and when to not use them
- How to write and use templates for maximum benefit
- How function templates, class templates, and variadic templates work
And you’ll be able to:
- Use C++ templates with ease
- Write templates yourself
- Avoid the most common pitfalls
- Read template-related error messages
This live event is for you because...
- You’re aiming to be a professional C++ developer.
- You’re a C++ developer who wants to cut down on development time.
Prerequisites
- Basic C++ experience
- Some knowledge about regular classes
Recommended preparation:
- Access to a C++14/17/20 compiler (Microsoft Visual Studio 2015+, GNU 4.8+, Clang 3.6+, or Intel 15.0+)
- Windows with Visual Studio CMake
Recommended follow-up:
- Read C++ Templates: The Complete Guide, second edition (book)
- Read Effective Modern C++ (book)
- Read A Tour of C++, second edition (book)
- Take C++ Essentials: STL Algorithms (live online course with Klaus Iglberger)
Schedule
The time frames are only estimates and may vary according to how the class is progressing.
Getting in touch with function templates (60 minutes)
- Presentation: The basics of function templates
- Hands-on exercise: Explore function templates
- Q&A
- Break
Advanced function templates (60 minutes)
- Hands-on exercises: Write overloads and specializations; write variadic function templates
- Q&A
- Break
Getting in touch with class templates (60 minutes)
- Presentation: The basics of class templates
- Hands-on exercise: Explore class templates
- Q&A
- Break
Class template specialization (50 minutes)
- Hands-on exercises: Explore a first-class template specialization; write your own class template specialization
Wrap-up and Q&A (10 minutes)
Your Instructor
Klaus Iglberger
Klaus Iglberger is a freelance C++ trainer and consultant. He is passionate talking about clean, safe and maintainable C++ and shares his expertise in popular C++ courses — from beginner to advanced — all around the world. He is the author of “C++ Software Design”, one of the organizers of the Munich C++ user group, and the (co-)organizer of the Back-to-Basics and Software Design tracks at CppCon.