Browse Source

Added comparison ops >, <=, >= to SourceLocation

merge-requests/37/head
Florian Jung 8 years ago
parent
commit
736112b70d
  1. 3
      src/source_location.h

3
src/source_location.h

@ -10,6 +10,9 @@ namespace clangmm {
bool operator==(const Offset &o) const {return line==o.line && index==o.index;} bool operator==(const Offset &o) const {return line==o.line && index==o.index;}
bool operator!=(const Offset &o) const {return !(*this==o);} bool operator!=(const Offset &o) const {return !(*this==o);}
bool operator<(const Offset &o) const {return line<o.line || (line==o.line && index<o.index);} bool operator<(const Offset &o) const {return line<o.line || (line==o.line && index<o.index);}
bool operator>(const Offset &o) const {return o < *this;}
bool operator<=(const Offset &o) const {return (*this == o) || (*this < o);}
bool operator>=(const Offset &o) const {return (*this == o) || (*this > o);}
unsigned line; unsigned line;
unsigned index; //byte index in line (not char number) unsigned index; //byte index in line (not char number)
}; };

Loading…
Cancel
Save