In your class template a
means a<All the tempalte args here>
i.e a<T>
So both your functions are same.
If you want provide another type you should use template function
template <typename T> {
class a {
template<typename U>
a<T> func(a<U> arg);
}
You may also consider return std::common_type<T, U>::type
but in your case it'll not compile because common type for float
and int
is float
a<float> x = a<int>(1) + a<float>(8)
should work in that case