Quick q,
What function takes precedence with a template function vs a non-template function?
I set up the following code but my result had the following output
Template
Template
even though a guide I read said it should read:
Template
Non-template
// Testing template function vs non-template function to see which function takes precedence when overloaded
template<class T>
void output(T x, T y)
{
cout << "Template" << endl;
}
void output(string x, string y)
{
cout << "Non-Template" << endl;
void main()
{
output(1,5); // I understand Template is output since
// the non-template function has arguments of type string
output("1", "k"); // ?
}
}