16 - Templates Flashcards
What is a template?
A template allows you to define functions and classes that have parameters for type names. This enables you to design functions that can be used with arguments of different types and to define classes that are very general.
What is the template prefix and how is its syntax?
The template prefix tells the compiler that the function declaration that follows is a template.
template
How do you call a function template?
You need not do anything special when you call a function that is defined with a function template.
What is the syntax for class templates?
The syntax details for class templates are basically the same as those for function templates:
template