From d734f1e7803a756822524e0580ec8e9c93b821c6 Mon Sep 17 00:00:00 2001 From: Felix Morgner Date: Fri, 25 Jul 2025 22:59:30 +0200 Subject: lib: make Turns.Participant comparable --- lib/include/turnsmm/participant.hpp | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'lib/include/turnsmm') diff --git a/lib/include/turnsmm/participant.hpp b/lib/include/turnsmm/participant.hpp index d7956ab..29ea1fa 100644 --- a/lib/include/turnsmm/participant.hpp +++ b/lib/include/turnsmm/participant.hpp @@ -17,6 +17,8 @@ #include #include +#include + namespace Turns { @@ -45,6 +47,9 @@ namespace Turns Participant(); Participant(Glib::ustring const & name, float priority, Disposition disposition); + auto operator<=>(Participant const & other) const noexcept -> std::strong_ordering; + auto operator==(Participant const & other) const noexcept -> bool; + [[nodiscard]] auto gobj() noexcept -> BaseObjectType *; [[nodiscard]] auto gobj() const -> BaseObjectType const *; [[nodiscard]] auto gobj_copy() noexcept -> BaseObjectType *; @@ -79,6 +84,11 @@ namespace Turns explicit Participant(BaseObjectType * gobj); }; + auto inline operator<=>(Glib::RefPtr const & lhs, Glib::RefPtr const & rhs) noexcept -> std::strong_ordering + { + return *lhs <=> *rhs; + } + } // namespace Turns namespace Glib -- cgit v1.2.3