Chapter 7. Basic Template Terminology

So far we have introduced the basic concept of templates in C++. Before we go into details, let’s look at the terms of the concepts we use. This is necessary because, inside the C++ community (and even in the standard), there is a lack of precision regarding concepts and terminology.

7.1 “Class Template” or “Template Class”?

In C++, structs, classes, and unions are collectively called class types. Without additional qualification, the word “class” in plain text type is meant to include class types introduced with either the keyword class or the keyword struct.1 Note specifically that “class type” includes unions, but “class” does not.

There is some confusion about how a class that is a template is called: ...

Get C++ Templates: The Complete Guide 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.