August 2001
Beginner
482 pages
10h 52m
English
Templates enable you to teach the compiler how to make a list of any type of thing, rather than creating a set of type-specific lists. A PartsList is a list of parts; a CatList is a list of cats. The only way in which they differ is the type of the thing on the list. With templates, the type of the thing on the list becomes a parameter to the definition of the class.
The act of creating an object (from a class)or a specific type from a template is called instantiation, and the individual classes are called instances of the template. |
Read now
Unlock full access