language: C++ 4.7.2 (gcc-4.7.2)
date: 341 days 23 hours ago
link:
visibility: public
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
 
template<typename T>
void f(T a, T b) {}
 
float get_value() //consider this too!
{
        return 1.0;
}
int main()
{
        f(get_value(), 1);   //compilation error
        f(get_value(), 1.0); //compilation error
        f(get_value(), 1.0f); //okay    
}
 
prog.cpp: In function ‘int main()’:
prog.cpp:11: error: no matching function for call to ‘f(float, int)’
prog.cpp:12: error: no matching function for call to ‘f(float, double)’