]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
utime: add != operator
authorSage Weil <sage@newdream.net>
Thu, 22 Oct 2009 23:50:01 +0000 (16:50 -0700)
committerSage Weil <sage@newdream.net>
Thu, 22 Oct 2009 23:51:20 +0000 (16:51 -0700)
src/include/utime.h

index 1940362aa6654894dc6ab06982ce293920fc0ebf..3b2905b219f6e280a7adb523829f7841aecfe063 100644 (file)
@@ -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)