From e44aa1c791bf2978a602d3b2310004cfbadb80d7 Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Thu, 22 Oct 2009 16:50:01 -0700 Subject: [PATCH] utime: add != operator --- src/include/utime.h | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/include/utime.h b/src/include/utime.h index 1940362aa6654..3b2905b219f6e 100644 --- a/src/include/utime.h +++ b/src/include/utime.h @@ -162,6 +162,8 @@ inline utime_t& operator-=(utime_t& l, double f) { return l; } + +// comparators inline bool operator>(const utime_t& a, const utime_t& b) { return (a.sec() > b.sec()) || (a.sec() == b.sec() && a.usec() > b.usec()); @@ -170,10 +172,15 @@ inline bool operator<(const utime_t& a, const utime_t& b) { return (a.sec() < b.sec()) || (a.sec() == b.sec() && a.usec() < b.usec()); } + inline bool operator==(const utime_t& a, const utime_t& b) { return a.sec() == b.sec() && a.usec() == b.usec(); } +inline bool operator!=(const utime_t& a, const utime_t& b) +{ + return a.sec() != b.sec() || a.usec() != b.usec(); +} // ostream inline std::ostream& operator<<(std::ostream& out, const utime_t& t) -- 2.39.5