I would like an opinion concerning this program:
The MinGW port of g++ 3.4.5 finds no fault with the above program. The Comeau online compiler, on the other hand, fails to compile it, citing this error:Code:#include <cmath> int main() { double x = 0.0; x = std::sqrt(x); }
Checking the C++ Standard, I see:Code:MODE:strict errors C++ C++0x_extensions "ComeauTest.c", line 6: error: more than one instance of overloaded function "std::sqrt" matches the argument list, the choices that match are: function "std::sqrt(float)" function "std::sqrt(long double)" The argument types that you used are: (double) x = std::sqrt(x); ^ 1 error detected in the compilation of "ComeauTest.c".
I conclude then that the error is due to a missing double sqrt(double) version of std::sqrt, and thus is a bug in the standard library implementation used by the Comeau online compiler. Am I correct?Originally Posted by C++03 Section 26.5 Paragraph 5



LinkBack URL
About LinkBacks



CornedBee