Cppreference mentions the overloads of std::isnan
and std::isinf
(and maybe others) for integral types. This makes the following call unambiguous:
std::isnan(1);
However, I cannot find any such overloads mentioned in the C++ Standard. I checked C++11 and the current draft, and there are only overloads for float
, double
, and long double
.
As for compiler behavior, GCC and Clang both compile the code, but MSVC does not. Who is right? Where did the integral overload on cppreference come from?
Aucun commentaire:
Enregistrer un commentaire