diff --git a/src/libs/karm-base/distinct.h b/src/libs/karm-base/distinct.h index 34d4962310..ee3a38d100 100644 --- a/src/libs/karm-base/distinct.h +++ b/src/libs/karm-base/distinct.h @@ -1,5 +1,7 @@ #pragma once +#include + namespace Karm { template @@ -12,29 +14,9 @@ struct Distinct { constexpr T value() const { return _value; } - constexpr bool operator==(Distinct other) const { - return _value == other._value; - } - - constexpr bool operator!=(Distinct other) const { - return _value != other._value; - } - - constexpr bool operator<(Distinct other) const { - return _value < other._value; - } + constexpr bool operator==(Distinct const &other) const = default; - constexpr bool operator>(Distinct other) const { - return _value > other._value; - } - - constexpr bool operator<=(Distinct other) const { - return _value <= other._value; - } - - constexpr bool operator>=(Distinct other) const { - return _value >= other._value; - } + constexpr auto operator<=>(Distinct const &other) const = default; constexpr Distinct operator+(Distinct other) const { return Distinct(_value + other._value);