From: Philippe Proulx Date: Mon, 2 May 2022 14:01:54 +0000 (-0400) Subject: Add bt2_common::UuidView::operator<() X-Git-Url: http://drtracing.org/?a=commitdiff_plain;h=c65e7e808b2d7724d6ee0b2727f8e283d9894aa2;p=babeltrace.git 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 --- 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;