Generic programming extends the language so that a single function (called template) can be written for a general (unspecified) type and used for multiple data types.
template<typename T> T square(T x) { return x * x; }