When using the double
variant of the std::abs()
function without the std
with g++ 4.6.1, no warning or error is given.
Be warned, you don't need to explicitly #include
,
does the damage as well (and maybe some other headers). Also, note that -Wall
doesn't give you any warnings about it.
#include
int main() {
std::cout << abs(.5) << std::endl;
std::cout << typeid(decltype(abs)).name() << std::endl;
}
Gives output
0
FiiE
On
gcc version 7.4.0 (Ubuntu 7.4.0-1ubuntu1~18.04)