October 2011
Beginner to intermediate
1200 pages
35h 33m
English
Class templates are like function templates in that you can have implicit instantiations, explicit instantiations, and explicit specializations, collectively known as specializations. That is, a template describes a class in terms of a general type, whereas a specialization is a class declaration generated by using a specific type.
The template examples you have seen so far in this chapter use implicit instantiations. That is, they declare one or more objects indicating the desired type, and the compiler generates a specialized class definition, using the recipe provided by the general template:
ArrayTP<int, 100> stuff; // implicit instantiation
The compiler doesn’t generate an implicit instantiation ...
Read now
Unlock full access