From c65e7e808b2d7724d6ee0b2727f8e283d9894aa2 Mon Sep 17 00:00:00 2001 From: Philippe Proulx Date: Mon, 2 May 2022 10:01:54 -0400 Subject: [PATCH 1/1] Add bt2_common::UuidView::operator<() 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 Change-Id: I297afa3c4ef00939ca3de659e1e72ced93a3310e Reviewed-on: https://review.lttng.org/c/babeltrace/+/7970 Reviewed-on: https://review.lttng.org/c/babeltrace/+/10819 Tested-by: jenkins --- src/cpp-common/uuid-view.hpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/cpp-common/uuid-view.hpp b/src/cpp-common/uuid-view.hpp index 6fae4430..7816f25e 100644 --- a/src/cpp-common/uuid-view.hpp +++ b/src/cpp-common/uuid-view.hpp @@ -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; -- 2.34.1