Add all pair_t comparison operators

This commit is contained in:
Behdad Esfahbod 2019-05-15 14:25:54 -07:00
parent f244224dbb
commit d3e1d5044f
1 changed files with 5 additions and 0 deletions

View File

@ -226,6 +226,11 @@ struct hb_pair_t
{ return hb_pair_t<T1, T2> (second, first); }
bool operator == (const pair_t& o) const { return first == o.first && second == o.second; }
bool operator != (const pair_t& o) const { return !(*this == o); }
bool operator < (const pair_t& o) const { return first < o.first || (first == o.first && second < o.second); }
bool operator >= (const pair_t& o) const { return !(*this < o); }
bool operator > (const pair_t& o) const { return first > o.first || (first == o.first && second > o.second); }
bool operator <= (const pair_t& o) const { return !(*this > o); }
T1 first;
T2 second;