W
Wolfgang Jeltsch
Hello,
consider the following code:
#include <iostream.h>
template < typename T >
int f( T v ) {
return 0;
}
int f( int i ) {
return i;
}
int main() {
cout << f( 1 ) << '\n';
return 0;
}
Is this correct and guaranteed to output 1? Or is there a conflict between
the template f which can be instantiated to
int f< int >( int )
and the function f which is declared as
int f( int )?
Wolfgang
consider the following code:
#include <iostream.h>
template < typename T >
int f( T v ) {
return 0;
}
int f( int i ) {
return i;
}
int main() {
cout << f( 1 ) << '\n';
return 0;
}
Is this correct and guaranteed to output 1? Or is there a conflict between
the template f which can be instantiated to
int f< int >( int )
and the function f which is declared as
int f( int )?
Wolfgang