[C++] Are compilers allowed to optimize ...

Started by
11 comments, last by Red Ant 12 years, 3 months ago
That NaN check might not work if you enable fp-fast or otherwise allow deviance from the floating point spec.

Just so you know.
Advertisement

I'm aware of that, but I've made a habit of doing it just because it makes it impossible to write silly stuff like

is_NaN( 6.3433 ) = false;

That assignment is always impossible, no matter if you return a bool or a const bool. Again, the const is simply ignored here, it doesn't make any difference whatsoever. The language simply does not allow assigning to scalar rvalues.

That assignment is always impossible, no matter if you return a bool or a const bool. Again, the const is simply ignored here, it doesn't make any difference whatsoever. The language simply does not allow assigning to scalar rvalues.


Yes, if you read my last post you'll see that I've already conceded that point. ;)

This topic is closed to new replies.

Advertisement