From f96bf1f3008091a0fdfd61e9d95a714b507b330a Mon Sep 17 00:00:00 2001 From: kimci86 Date: Sat, 4 May 2024 22:28:08 +0200 Subject: [PATCH] Rename Rect comparison operands to avoid confusion --- include/SFML/Graphics/Rect.hpp | 16 ++++++++-------- include/SFML/Graphics/Rect.inl | 8 ++++---- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/include/SFML/Graphics/Rect.hpp b/include/SFML/Graphics/Rect.hpp index c7be7cc4f..fbcad4bd7 100644 --- a/include/SFML/Graphics/Rect.hpp +++ b/include/SFML/Graphics/Rect.hpp @@ -125,14 +125,14 @@ public: /// /// This operator compares strict equality between two rectangles. /// -/// \param left Left operand (a rectangle) -/// \param right Right operand (a rectangle) +/// \param lhs Left operand (a rectangle) +/// \param rhs Right operand (a rectangle) /// -/// \return True if \a left is equal to \a right +/// \return True if \a lhs is equal to \a rhs /// //////////////////////////////////////////////////////////// template -[[nodiscard]] constexpr bool operator==(const Rect& left, const Rect& right); +[[nodiscard]] constexpr bool operator==(const Rect& lhs, const Rect& rhs); //////////////////////////////////////////////////////////// /// \relates Rect @@ -140,14 +140,14 @@ template /// /// This operator compares strict difference between two rectangles. /// -/// \param left Left operand (a rectangle) -/// \param right Right operand (a rectangle) +/// \param lhs Left operand (a rectangle) +/// \param rhs Right operand (a rectangle) /// -/// \return True if \a left is not equal to \a right +/// \return True if \a lhs is not equal to \a rhs /// //////////////////////////////////////////////////////////// template -[[nodiscard]] constexpr bool operator!=(const Rect& left, const Rect& right); +[[nodiscard]] constexpr bool operator!=(const Rect& lhs, const Rect& rhs); // Create type aliases for the most common types using IntRect = Rect; diff --git a/include/SFML/Graphics/Rect.inl b/include/SFML/Graphics/Rect.inl index c68a27f53..170a4fd76 100644 --- a/include/SFML/Graphics/Rect.inl +++ b/include/SFML/Graphics/Rect.inl @@ -120,17 +120,17 @@ constexpr Vector2 Rect::getCenter() const //////////////////////////////////////////////////////////// template -constexpr bool operator==(const Rect& left, const Rect& right) +constexpr bool operator==(const Rect& lhs, const Rect& rhs) { - return (left.position == right.position) && (left.size == right.size); + return (lhs.position == rhs.position) && (lhs.size == rhs.size); } //////////////////////////////////////////////////////////// template -constexpr bool operator!=(const Rect& left, const Rect& right) +constexpr bool operator!=(const Rect& lhs, const Rect& rhs) { - return !(left == right); + return !(lhs == rhs); } } // namespace sf