The classic C++ language admits two basic types of templates—function templates and class templates2: Here is a function template: template scalar_t sq(const scalar_t& x) { return x*x; } Here is a class template: template < typename scalar_t, // type parameter bool EXTRA_PRECISIO