Templates - Syntax


A template defines a family of functions or classes. The syntax of template declarations is shown below.

Syntax

template_declaration:
       template <template_parameter_list> declaration
 
template_parameter_list:
       template_parameter
       template_parameter_list, template_parameter
 
template_parameter:
       type_parameter
       parameter_declaration
 
type_parameter:
       class identifier

Notes