Class Central is learner-supported. When you buy through links on our site, we may earn an affiliate commission.

Coursera

Modern C++ Templates In Depth

Packt via Coursera

Overview

Coursera Flash Sale
40% Off Coursera Plus for 3 Months!
Grab it
This course features Coursera Coach! A smarter way to learn with interactive, real-time conversations that help you test your knowledge, challenge assumptions, and deepen your understanding as you progress through the course. In this comprehensive course, you will dive deep into the world of C++ templates, gaining both theoretical knowledge and practical experience. You’ll start with foundational concepts like template syntax and basic function templates, before advancing to more complex topics like class templates, specialization, and template instantiation. By understanding how templates enhance code reusability and flexibility, you’ll unlock powerful programming techniques to elevate your C++ skills. The course is structured into distinct modules focusing on key areas such as function templates, class templates, and template changes across C++ standards. You'll explore critical topics like non-type template parameters, template argument deduction, and the practical uses of variadic templates. In addition, we'll cover template optimizations introduced in C++11, C++14, C++17, and C++20, ensuring you’re equipped with the most up-to-date tools for real-world applications. Whether you're a seasoned C++ developer or someone eager to master template programming, this course will provide you with the depth of knowledge required to use templates effectively in modern C++ programming. By tackling hands-on examples and a final project, you'll sharpen your problem-solving skills and get exposure to best practices in template-based design. This course is perfect for intermediate to advanced programmers who already have a basic understanding of C++ syntax and object-oriented programming principles. It’s ideal for developers aiming to specialize in template programming and those who want to improve their skills in managing complex codebases. By the end of the course, you will be able to create and optimize function and class templates, apply advanced template features introduced in modern C++ standards, use explicit and partial specialization, and confidently implement templates in real-world projects.

Syllabus

  • Introduction
    • In this module, we will introduce you to the course's structure, its primary goals, and why templates are a vital part of modern C++ programming. You'll gain a solid understanding of template syntax and learn the core concepts that will form the foundation for the rest of the course.
  • Function Templates
    • In this module, we will dive into the fundamentals of function templates, covering how they are created, instantiated, and specialized. You'll explore various techniques such as overloading, argument conversions, and optimization strategies like extern templates to enhance compilation.
  • Class Templates
    • In this module, we will focus on class templates, teaching you how to create and instantiate them efficiently. We will also explore advanced techniques like explicit specialization and partial specialization to handle specific scenarios in your template programming.
  • Passing Arguments
    • In this module, we will explain the role of different parameter types in templates, emphasizing forwarding references to improve the versatility of your code. You will learn how these concepts contribute to more efficient and reusable template functions.
  • Template Changes In C++11
    • In this module, we will explore the most significant template-related changes in C++11, such as variadic templates, type aliases, and the right angle bracket syntax. You will learn how these innovations help streamline template programming and reduce code complexity.
  • Template Changes in C++14/17
    • In this module, we will focus on the advancements in template programming from C++14 and C++17. Key topics include the introduction of variable templates, generic lambdas, and more efficient ways to handle variadic templates using fold expressions and compile-time conditions.
  • Template Changes in C++20
    • In this module, we will cover the template changes in C++20, focusing on enhancements like non-type template parameters, template parameters in lambdas, and the new abbreviated auto syntax. You will learn how these features can optimize your template-based code.
  • Project
    • In this module, we will guide you through a hands-on project where you'll apply the techniques learned throughout the course. You'll implement core methods, test your template code, and modernize the project using advanced C++ features to maximize efficiency and maintainability.

Taught by

Packt - Course Instructors

Reviews

Start your review of Modern C++ Templates In Depth

Never Stop Learning.

Get personalized course recommendations, track subjects and courses with reminders, and more.

Someone learning on their laptop while sitting on the floor.