Sun Studio 12: C++ User's Guide

6.3.2.1 Explicit Instantiation of Template Functions

To instantiate a template function explicitly, follow the template keyword by a declaration (not definition) for the function, with the function identifier followed by the template arguments.


template float twice<float>(float original);

Template arguments may be omitted when the compiler can infer them.


template int twice(int original);