Answer the question
In order to leave comments, you need to log in
How to call a template function from a template overloaded function?
When I want to call the first func () from the second, the compiler swears that there are few arguments. For some reason, he does not see the first template function
template <typename T>
void func(T a) {
std::cout << a <<std::endl;
}
template <typename T>
void func(T a, T b) {
func(a);
func(b);
}
int main() {
func(1, 2);
}
Answer the question
In order to leave comments, you need to log in
Try explicitly specifying which template function you are calling,func<T>(arg)
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question