!= check on struct datatype

Whandall:
@PieterP

Why do you qualify the local members by this-> ?
That would normaly only be needed if there are local variables/parameters hiding the name.

You are checking the third member (which is a float) for equality, which is not a good idea generally, wouldn't

abs(three - rhs.three) < 0.0001

be safer?

  1. It's not required, but it makes the code more readable in my eyes, because there are two 'one's, this one, and the other one. That's personal preference, of course.

  2. It all depends on what the OP wants to achieve of course. But you are correct, generally, one would use an epsilon value to check for float equality.