From 45256116d0dc6455d30a414fd507d98f5386b38f Mon Sep 17 00:00:00 2001 From: Paul Hariel Date: Wed, 27 Sep 2023 14:49:24 +0200 Subject: [PATCH] Add more explicit comparison operators for clang --- shared/include/snowflake.h | 4 ++-- shared/src/snowflake.cpp | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/shared/include/snowflake.h b/shared/include/snowflake.h index fff4baa..745ec5c 100644 --- a/shared/include/snowflake.h +++ b/shared/include/snowflake.h @@ -45,10 +45,10 @@ namespace pine bool operator ==(snowflake const& other) const; /// @brief Compare a snowflake with an id. - bool operator !=(uint64_t const& other) const; + bool operator !=(uint64_t other) const; /// @brief Compare a snowflake with an id. - bool operator ==(uint64_t const& other) const; + bool operator ==(uint64_t other) const; /// @brief Convert the snowflake to an id. constexpr operator uint64_t() const diff --git a/shared/src/snowflake.cpp b/shared/src/snowflake.cpp index 6cb1014..22b8c29 100644 --- a/shared/src/snowflake.cpp +++ b/shared/src/snowflake.cpp @@ -48,12 +48,12 @@ namespace pine && value.sequence == other.value.sequence; } - bool snowflake::operator !=(uint64_t const& other) const + bool snowflake::operator != (uint64_t other) const { - return !(*this == other); + return !(static_cast(*this) == other); } - bool snowflake::operator ==(uint64_t const& other) const + bool snowflake::operator ==(uint64_t other) const { return static_cast(*this) == other; }