Suppose I have a set of functions and classes which are templated to use single (float) or double precision. Of course I could write just two piece
float
double
Templates are a compile-time mechanism. BTW, macros are as well (strictly speaking - a preprocessing mechanism - that comes even before compilation).