summaryrefslogtreecommitdiff
path: root/lib/src/turnsmm/participant.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lib/src/turnsmm/participant.cpp')
-rw-r--r--lib/src/turnsmm/participant.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/lib/src/turnsmm/participant.cpp b/lib/src/turnsmm/participant.cpp
index 758f062..81b2777 100644
--- a/lib/src/turnsmm/participant.cpp
+++ b/lib/src/turnsmm/participant.cpp
@@ -22,6 +22,7 @@
#include <glibmm/wrap.h>
#include <bit>
+#include <compare>
namespace Turns
{
@@ -84,6 +85,17 @@ namespace Turns
{
}
+ auto Participant::operator<=>(Participant const & other) const noexcept -> std::strong_ordering
+ {
+ auto result = turns_participant_compare(unwrap(this), other.gobj());
+ return result == 0 ? std::strong_ordering::equivalent : (result < 0 ? std::strong_ordering::less : std::strong_ordering::greater);
+ }
+
+ auto Participant::operator==(Participant const & other) const noexcept -> bool
+ {
+ return (*this <=> other) == std::strong_ordering::equivalent;
+ }
+
auto Participant::gobj() noexcept -> BaseObjectType *
{
return std::bit_cast<BaseObjectType *>(gobject_);