Using a Template Library

A template class is similar to a family of classes that provides the same basic functionality, yet operates on multiple data types. However, instead of defining a separate class for each data type, you define one class that takes one or more formal data types as a parameter(s). When you instantiate the class, you pass the appropriate data types as the actual parameters. The compiler then expands the class definition, substituting the actual type parameters for the formal type parameters used in the template specification.

By combining the benefits of template classes with the advantages of multiple inheritance, which enables you to reuse existing classes, ATL for Windows CE helps you create small, fast, and efficient COM components and ActiveX controls.