October 1997
Intermediate to advanced
800 pages
20h 48m
English
The C++ template mechanism supports the implementation of generic classes.
A template class provides the same set of behaviors for objects instantiated with different types. Template classes eliminate code duplication for different data types and make library design easier and more manageable.
Template classes are typically container classes implemented with either value or pointer semantics.
Outside template class definitions, you must use Class_name<TYPE> with the scope operator (::), template function argument types, and template function return types.
Specializing nontemplate classes for specific types is viable when a template class does not perform efficiently or does not apply to that type. The class definition for ...