18 Introduction to Custom Templates

Objectives

In this chapter you’ll:

  • Use class templates to create groups of related classes.

  • Distinguish between class templates and class-template specializations.

  • See how nontype template parameters can be used in place of constants declared inside a class.

  • Learn about default template arguments.

  • Learn about overloading function templates.

Get C++ How to Program, 10/e now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.