Browse Source

iota_iterator: internal changes (coding style)

skypjack 1 tháng trước cách đây
mục cha
commit
8a51b5950c
1 tập tin đã thay đổi với 9 bổ sung12 xóa
  1. 9 12
      src/entt/core/iterator.hpp

+ 9 - 12
src/entt/core/iterator.hpp

@@ -104,22 +104,19 @@ public:
         return current;
         return current;
     }
     }
 
 
+    /**
+     * @brief Comparison operator.
+     * @param other A properly initialized iota iterator.
+     * @return True if the two iterators are identical, false otherwise.
+     */
+    [[nodiscard]] constexpr bool operator==(const iota_iterator &other) const noexcept {
+        return current == other.current;
+    }
+
 private:
 private:
     value_type current;
     value_type current;
 };
 };
 
 
-/**
- * @brief Comparison operator.
- * @tparam Type Value type of the iota iterator.
- * @param lhs A properly initialized iota iterator.
- * @param rhs A properly initialized iota iterator.
- * @return True if the two iterators are identical, false otherwise.
- */
-template<typename Type>
-[[nodiscard]] constexpr bool operator==(const iota_iterator<Type> &lhs, const iota_iterator<Type> &rhs) noexcept {
-    return *lhs == *rhs;
-}
-
 /**
 /**
  * @brief Utility class to create an iterable object from a pair of iterators.
  * @brief Utility class to create an iterable object from a pair of iterators.
  * @tparam It Type of iterator.
  * @tparam It Type of iterator.