Is it possible to define the default value for variables of a template function in C++?
Something like below:
template T sum(T a, T b,
Yes!
However you should at least have an idea about what T could be or it's useless.
You can't set the default value of template parameters for functions, i.e. this is forbidden:
template void f(T a, T b);