C++: Using Function Templates

C++ 20    |    Expert
  • 14 videos | 1h 47m 15s
  • Includes Assessment
  • Earns a Badge
Template metaprogramming is a powerful computer science technique used to achieve code reuse and some incredibly elegant architectures. In C++, template metaprogramming is achieved via template functions and classes that are instantiated at compile-time, not at runtime. In this course, learn how to define and instantiate function templates to effectively provide compile-time polymorphism. Then, explore how template definitions can make assumptions about the template parameters. Finally, learn how to define and use templates with pointer and reference types to provide function overloading.


  • discover the key concepts covered in this course
    illustrate the use of function and class templates
    recall the need for function templates
    recognizing the nuances of function templates
    name templates to explicitly specify their type
    define templated functions in header files and use templates for reference types
    use templated functions in .cpp files with header files
  • invoke functions with templates on user-defined types
    outline how functions with function templates can mismanage pointers
    define template specializations
    invoke functions with specialized templates
    overload templated functions
    overload templated functions with pointer types
    summarize the key concepts covered in this course


  • 1m 38s
  • 10m 14s
  • Locked
    3.  Defining the Use Case of Function Templates
    8m 12s
  • Locked
    4.  Recognizing the Finer Points of Function Templates
    5m 52s
  • Locked
    5.  Specifying Types for Templates
    10m 3s
  • Locked
    6.  Defining Templated Functions in Header Files
    7m 21s
  • Locked
    7.  Using Templated Functions in .cpp Files
    10m 28s
  • Locked
    8.  Using Function Templates with Custom Types
    7m 8s
  • Locked
    9.  Demonstrating Issues of Pointers with Templates
    10m 30s
  • Locked
    10.  Defining Template Specializations
    7m 36s
  • Locked
    11.  Using Template Specializations
    10m 42s
  • Locked
    12.  Overloading Templated Functions
    8m 2s
  • Locked
    13.  Overloading Templated Functions with Pointer Types
    7m 24s
  • Locked
    14.  Course Summary
    2m 6s


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.