I was browsing through some code written by another programmers code, to try and learn from it. I eventually ran into this code:
inline const FLOAT minx() const { return p1.x <? p2.x; }
inline const FLOAT maxx() const { return p1.x >? p2.x; }
This code didn't compile, and I was able to make it work by changing the code to this:
inline const FLOAT minx() const { return p1.x < p2.x ? p1.x : p2.x; }
inline const FLOAT minx() const { return p1.x > p2.x ? p1.x : p2.x; }
By doing so I can already assume what the code is supposed to do. But searching around I haven't found any other examples that implement it this way. Was this just bad code, that doesn't even compile, or does this actually work on certain compilers (and how?).
Thank you.