Interfaces for function templates are mostly similar to those for
functions. For example, the following syntax declares an interface in a
dynamic file for a function template of the name
list0_fold_left:
If the same interface is declared in a static file, the keyword
extern should be dropped. Implementing an interface for a
function template is also mostly similar to implementing one for a
function. The above interface for
list0_fold_left is given an implementation in the
following code:
Note that template parameters are required to appear immediately after the
keyword
implement, and they cannot be omitted. Template
parameters can also be passed sequentially as is shown in the following
short example:
The style of template implementation presented in this section is
referred to as generic template implementation. I will later present a
different style of template implementation, which is often referred to as
specific template implementation.