HNHacker News
TopNewBestAskShowJobs

idea1434

-1 karma · joined November 12, 2017

submissionscomments
idea1434··on Trip report: Fall ISO C++ standards meeting
It just makes more sense. Similar to how a<=b is equivalent to (a<b)&&(a==b).

Coming up with an entirely fresh meaning for <=> involving spaceships and a conglomerated comparative threesome just seems illogical to me, given the original meanings of the component symbols of <=>.

idea1434··on Trip report: Fall ISO C++ standards meeting
No, it would be the same as evaluating (a<b)&&(a==b)&&(a>b), not std::is_nan.
idea1434··on Trip report: Fall ISO C++ standards meeting
No, it could be used for any type. It would be equivalent to (a<b)&&(a==b)&&(a>b), but would be most useful for floating point, where this operator would evaluate to false if a or b is NaN.
idea1434··on Trip report: Fall ISO C++ standards meeting
I would like to see a spaceship operator for floating point comparison, where a<=>b means a is less than, equal to, or greater than b. It would be useful for checking that a and b aren't NaN. If either were NaN, then the comparison would return false.