C++: Using Class Templates

C++ 20    |    Expert
  • 15 videos | 1h 52m 8s
  • Includes Assessment
  • Earns a Badge
Class templates are a way of reusing code for classes parameterized by types of internal state variables, just as function templates are a way of reusing code for functions parameterized by the types of input arguments and return types. In this course you will discover how to define and instantiate class templates, along with common uses of templated classes. Learn how to use the braced initialization list constructor and explore how the compiler provides this special construct so that container objects can be initialized from a list of values. Finally, investigate partial and full template specializations, and how partial specializations can be used to correctly deal with pointer types.


  • discover the key concepts covered in this course
    explore class template parameters
    create and instantiate classes with class template parameters
    work with the braced initialization list constructor
    use the braced initialization list constructor and let the compiler deduce template parameters
    recognize side effects of braced initialization list constructors
    use non-type template parameters with classes
    illustrate the features of non-type parameters
  • create specializations of class templates
    use specialized templates
    create a partial specialization to manage pointers
    fix one out of multiple template parameters using partial specializations
    check template type parameters using static_assert
    define friend functions to templated classes using the introvert and extrovert patterns
    summarize the key concepts covered in this course


  • 1m 49s
  • 7m 36s
  • Locked
    3.  Creating Classes with Template Parameters
    8m 28s
  • Locked
    4.  Using the Braced Initialization List Constructor
    10m 27s
  • Locked
    5.  Automatically Deducing Class Template Parameters
    6m 45s
  • Locked
    6.  Using Functional Notation for Initializing Variables
    5m 38s
  • Locked
    7.  Using Non-type Template Parameters with Classes
    7m 49s
  • Locked
    8.  Demonstrating Features of Non-type Parameters
    7m 57s
  • Locked
    9.  Specializing Class Templates
    8m 56s
  • Locked
    10.  Using Specialized Templates
    7m 27s
  • Locked
    11.  Using Partial Specializations
    8m 16s
  • Locked
    12.  Performing Partial Specializations
    11m 16s
  • Locked
    13.  Using static_assert
    9m 40s
  • Locked
    14.  Defining Friend Functions to Templated Classes
    6m 14s
  • Locked
    15.  Course Summary
    3m 50s


Skillsoft is providing you the opportunity to earn a digital badge upon successful completion on some of our courses, which can be shared on any social network or business platform.

Digital badges are yours to keep, forever.