From d6f81962638a41ac24aa4e0c00c07315ef7cf5b1 Mon Sep 17 00:00:00 2001 From: Ubpa <641614112@qq.com> Date: Mon, 3 Aug 2020 12:42:21 +0800 Subject: [PATCH] Entity : friend -> member --- include/UECS/Entity.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/include/UECS/Entity.h b/include/UECS/Entity.h index fc94a24..f936567 100644 --- a/include/UECS/Entity.h +++ b/include/UECS/Entity.h @@ -8,11 +8,11 @@ namespace Ubpa::UECS { public: size_t Idx() const noexcept { return idx; } size_t Version() const noexcept { return version; } - friend bool operator==(const Entity& x, const Entity& y) noexcept { - return x.idx == y.idx && x.version == y.version; + bool operator==(const Entity& rhs) const noexcept { + return idx == rhs.idx && version == rhs.version; } - friend bool operator<(const Entity& x, const Entity& y) noexcept { - return x.idx < y.idx || (x.idx == y.idx && x.version < y.version); + bool operator<(const Entity& rhs) const noexcept { + return idx < rhs.idx || (idx == rhs.idx && version < rhs.version); } static constexpr Entity Invalid() noexcept { return { size_t_invalid,size_t_invalid }; } private: