News for hackers. Stuff that matters.
Re:Why C++ is vastly superior to C by mnutt on Saturday May 14, 2011 @11:55AM (#2547883)
Maybe it's just coming from a dynamic language, but it appears that you've overridden the bool operators to always return true. (except when you pass in 0 and 0.0) If you redefine how two structs of different kinds are compared, who is the compiler to say it's a problem?
Re:Why C++ is vastly superior to C by spullara on Saturday May 14, 2011 @12:29PM (#2547954)
In most dynamic languages 0 is false and anything else is true but it normally wouldn't use that information to coerce two values of different types to booleans before comparing them.
Re:Why C++ is vastly superior to C by mnutt on Saturday May 14, 2011 @12:48PM (#2548005)
I'm only aware of php and javascript equating 0 to false. But at any rate in this case it's not equating 0 to false, it's comparing non-zero to zero and returning true. (as it should)
Re:Why C++ is vastly superior to C by burgerbrain on Saturday May 14, 2011 @01:12PM (#2548065)
In C, 0 evaluates to false.