Skip to content

Commit

Permalink
grn_ts: enable comparison operators
Browse files Browse the repository at this point in the history
  • Loading branch information
s-yata committed Aug 24, 2015
1 parent e0bb2fb commit 4f23900
Show file tree
Hide file tree
Showing 2 changed files with 795 additions and 366 deletions.
8 changes: 6 additions & 2 deletions lib/grn_ts.hpp
Expand Up @@ -83,8 +83,12 @@ struct Float {
~Float() {}
};

inline bool operator==(Float lhs, Float rhs) { return lhs.raw == rhs.raw; }
inline bool operator!=(Float lhs, Float rhs) { return lhs.raw != rhs.raw; }
inline bool operator==(Float lhs, Float rhs) {
return (lhs.raw <= rhs.raw) && (lhs.raw >= rhs.raw);
}
inline bool operator!=(Float lhs, Float rhs) {
return (lhs.raw < rhs.raw) || (lhs.raw > rhs.raw);
}
inline bool operator<(Float lhs, Float rhs) { return lhs.raw < rhs.raw; }
inline bool operator<=(Float lhs, Float rhs) { return lhs.raw <= rhs.raw; }
inline bool operator>(Float lhs, Float rhs) { return lhs.raw > rhs.raw; }
Expand Down

0 comments on commit 4f23900

Please sign in to comment.