Add bt2_common::UuidView::operator<()
authorPhilippe Proulx <eeppeliteloop@gmail.com>
Mon, 2 May 2022 14:01:54 +0000 (10:01 -0400)
committerPhilippe Proulx <eeppeliteloop@gmail.com>
Mon, 11 Sep 2023 15:24:02 +0000 (11:24 -0400)
Makes it possible to use a `bt2_common::UuidView` as an `std::set` value
type or an `std::map` key type.

Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Change-Id: I297afa3c4ef00939ca3de659e1e72ced93a3310e
Reviewed-on: https://review.lttng.org/c/babeltrace/+/7970
Reviewed-on: https://review.lttng.org/c/babeltrace/+/10819
Tested-by: jenkins <jenkins@lttng.org>
src/cpp-common/uuid-view.hpp

index 6fae4430da305de1329aad8cfe4cd2a2ca908ad3..7816f25ea9135e24404a3f375453663fe67170bb 100644 (file)
@@ -37,6 +37,11 @@ public:
         return !(*this == other);
     }
 
+    bool operator<(const UuidView& other) const noexcept
+    {
+        return bt_uuid_compare(_mUuid, other._mUuid) < 0;
+    }
+
     std::string string() const
     {
         std::string s;
This page took 0.025446 seconds and 4 git commands to generate.