http://d.puremagic.com/issues/show_bug.cgi?id=8562


Jonathan M Davis <jmdavisp...@gmx.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |jmdavisp...@gmx.com


--- Comment #4 from Jonathan M Davis <jmdavisp...@gmx.com> 2012-08-20 10:04:39 
PDT ---
> To avoid the casting in isNaN() you would need to know when it's getting 
> called at compile-time and when it's getting called at run-time, correct?  
> There is no way to know that, so we end up with two functions, isNaN() and 
> staticIsNaN(), correct?

Wrong. __ctfe is true during CTFE and not during runtime. So, you can do

if(__ctfe)
{
    //ctfe version
}
else
{
    //normal version
}

http://dlang.org/function.html#interpretation

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------

Reply via email to