<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<div class="moz-cite-prefix">Am 1/14/13 6:01 PM, schrieb Howard
Hinnant:<br>
</div>
<blockquote
cite="mid:E599D089-F8CC-44CD-B834-B1F0C0378AA6@apple.com"
type="cite">
<pre wrap="">
On Jan 14, 2013, at 11:58 AM, Kal Conley <a class="moz-txt-link-rfc2396E" href="mailto:kcconley@gmail.com"><kcconley@gmail.com></a> wrote:
</pre>
<blockquote type="cite">
<pre wrap="">Am 1/14/13 5:15 PM, schrieb Howard Hinnant:
</pre>
<blockquote type="cite">
<pre wrap="">On Jan 14, 2013, at 8:25 AM, Kal Conley <a class="moz-txt-link-rfc2396E" href="mailto:kcconley@gmail.com"><kcconley@gmail.com></a> wrote:
</pre>
<blockquote type="cite">
<pre wrap="">Hi,
I am getting compile errors trying to compile code which tries to do
something equivalent to std::isfinite((int)0). I get:
test.cc:27:3: error: no matching function for call to 'isfinite'
std::isfinite((int)0);
^~~~~~~~~~~~~
/usr/bin/../lib/c++/v1/cmath:376:1: note: candidate template ignored:
substitution failure [with _A1 = int]
isfinite(_A1 __x)
This compiles OK on all versions of libstdc++ that I have tried. Is
libc++'s implementation correct here? Should it be relying on templates
and only allowing specializations that satisfy std::is_floating_point?
</pre>
</blockquote>
<pre wrap="">This looks like a libc++ bug to me. Prior to Oct. 2010 libc++ was correct that std::isfinite should only accept floating point arguments. But two paragraphs were reordered in N3126 with the result that std::isfinite (and several other functions) should now accept integral arguments as well. I had not noticed the impact of this paragraph reordering until now.
Howard
</pre>
</blockquote>
<pre wrap="">Which paragraphs do you have in mind?
</pre>
</blockquote>
<pre wrap="">
In <a class="moz-txt-link-freetext" href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2010/n3126.pdf">http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2010/n3126.pdf</a>
26.8/p10 and the deleted paragraph after p11.
Howard
</pre>
</blockquote>
You mean "The classification/comparison functions behave the same as
the C macros with the corresponding names defined in..." and since
the C macros seem to accept integer types so should the c++
variants? Is it even defined behavior in the C standard to pass
integers to these macros?
<meta http-equiv="content-type" content="text/html;
charset=ISO-8859-1">
</body>
</html>