P
Prune Tracy
Hi, I can't get this seemingly harmless code to compile with Comeau online.
#include <cmath>
typedef float (*float_func)(float);
typedef double (*double_func)(double);
int main() {
float_func f = std::sqrt; // OK
double_func d = std::sqrt; // line 8: error
}
Comeau says:
line 8: error: no instance of overloaded function "std::sqrt"
matches the required type
It works fine on gcc 3.2.3. Is gcc wrong to accept it?
What is the cause of this?
Thanks.
#include <cmath>
typedef float (*float_func)(float);
typedef double (*double_func)(double);
int main() {
float_func f = std::sqrt; // OK
double_func d = std::sqrt; // line 8: error
}
Comeau says:
line 8: error: no instance of overloaded function "std::sqrt"
matches the required type
It works fine on gcc 3.2.3. Is gcc wrong to accept it?
What is the cause of this?
Thanks.