I'm trying to learn templates in c++ and i came across with a doubt that i can't find answers for. I'm sorry in advance if this is not a proper question.
If i have the following code:
template< class T >
T func( T a, T b )
{
return a + b;
}
And then:
int number = func( 2, 3 );
Will number simply be set to 5 or will a function
int func( int a, int b )
{
return a + b;
}
be generated?
I need to know if i can make a template that checks if a certain string is in a file.