Template is powerful in C++, you can do all sort of crazy thing
templateT fun(T a, T b){ return a + b; } // You can use default argument too template < typename T = int > T fun(T a, T b = 0){ return a + b; }
C++ class template
template < class T=int > class MyClass{ public: MyClass(T a, T b=0){ } };