]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
include/uuid: give uuid_d a < comparator
authorJohn Spray <john.spray@redhat.com>
Wed, 12 Jul 2017 21:20:02 +0000 (17:20 -0400)
committerJohn Spray <john.spray@redhat.com>
Fri, 21 Jul 2017 10:27:27 +0000 (06:27 -0400)
This is only there so that a variant<> containing
a uuid (amongst other types) can have operator< acting on it.

Signed-off-by: John Spray <john.spray@redhat.com>
src/include/uuid.h

index bd888f863da10318329058cfde41adf96d378130..98ee4b70be1feecab5389e68481a795b08966c8c 100644 (file)
@@ -74,6 +74,9 @@ inline bool operator==(const uuid_d& l, const uuid_d& r) {
 inline bool operator!=(const uuid_d& l, const uuid_d& r) {
   return l.uuid != r.uuid;
 }
+inline bool operator<(const uuid_d& l, const uuid_d& r) {
+  return l.to_string() < r.to_string();
+}
 
 
 #endif