### Template Syntax

The syntax for a template is:

                     /------------------------\
    >>--template--\-----argument-declaration----->--><
                  |   |                      |
                      \-type--identifier-----/

The declaration in a template declaration must define or declare one of the following:

- A class
- A function
- A static member of a template class

The identifier of a type is defined to be a type_ name in the scope of the template declaration. A template declaration can appear as a global declaration only.

The template arguments (within the < and > delimiters) specify the types and the constants within the template that must be specified when the template is instantiated.

Default intializers are permitted in template arguments, under the following conditions:

- They can only be applied to nontype template arguments.
- Like functions, they can only be applied to trailing arguments.
- Subsequent template declarations can add default initializers but cannot redefine existing default initializers.
- They can only be applied to class template declarations, not to function template declarations.

Note: A template that defines a member function of a class template is treated as a function template. Such a template cannot have default intializers.

Structuring Your Program Using Templates
Class Templates

Examples of Templates
Example of Default Initializers in Templates

Function Templates
Static Members