Comment by Gupie

Comment by Gupie a day ago

3 replies

Why can't you use this for the comparison operator:

  bool operator<(const interval& x, const interval& y)
  {
     if x.min < y.min return true;
     if x.min > y.min return false;
     return x_max < y.max;
   }
Sharlin a day ago

That’s fine if you just need any well-defined SWO, but I presume the author needs this specific ordering for some algorithmic reason. Still, it’s pretty ugly for a comparator to be throwing.