|
@@ -129,49 +129,25 @@ public:
|
|
|
return operator[](0);
|
|
return operator[](0);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- template<typename Lhs, typename Rhs>
|
|
|
|
|
- friend constexpr std::ptrdiff_t operator-(const dense_map_iterator<Lhs> &, const dense_map_iterator<Rhs> &) noexcept;
|
|
|
|
|
|
|
+ template<typename Other>
|
|
|
|
|
+ [[nodiscard]] constexpr std::ptrdiff_t operator-(const dense_map_iterator<Other> &other) const noexcept {
|
|
|
|
|
+ return it - other.it;
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
- template<typename Lhs, typename Rhs>
|
|
|
|
|
- friend constexpr bool operator==(const dense_map_iterator<Lhs> &, const dense_map_iterator<Rhs> &) noexcept;
|
|
|
|
|
|
|
+ template<typename Other>
|
|
|
|
|
+ [[nodiscard]] constexpr bool operator==(const dense_map_iterator<Other> &other) const noexcept {
|
|
|
|
|
+ return it == other.it;
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
- template<typename Lhs, typename Rhs>
|
|
|
|
|
- friend constexpr bool operator<(const dense_map_iterator<Lhs> &, const dense_map_iterator<Rhs> &) noexcept;
|
|
|
|
|
|
|
+ template<typename Other>
|
|
|
|
|
+ [[nodiscard]] constexpr auto operator<=>(const dense_map_iterator<Other> &other) const noexcept {
|
|
|
|
|
+ return it <=> other.it;
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
private:
|
|
private:
|
|
|
It it;
|
|
It it;
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
-template<typename Lhs, typename Rhs>
|
|
|
|
|
-[[nodiscard]] constexpr std::ptrdiff_t operator-(const dense_map_iterator<Lhs> &lhs, const dense_map_iterator<Rhs> &rhs) noexcept {
|
|
|
|
|
- return lhs.it - rhs.it;
|
|
|
|
|
-}
|
|
|
|
|
-
|
|
|
|
|
-template<typename Lhs, typename Rhs>
|
|
|
|
|
-[[nodiscard]] constexpr bool operator==(const dense_map_iterator<Lhs> &lhs, const dense_map_iterator<Rhs> &rhs) noexcept {
|
|
|
|
|
- return lhs.it == rhs.it;
|
|
|
|
|
-}
|
|
|
|
|
-
|
|
|
|
|
-template<typename Lhs, typename Rhs>
|
|
|
|
|
-[[nodiscard]] constexpr bool operator<(const dense_map_iterator<Lhs> &lhs, const dense_map_iterator<Rhs> &rhs) noexcept {
|
|
|
|
|
- return lhs.it < rhs.it;
|
|
|
|
|
-}
|
|
|
|
|
-
|
|
|
|
|
-template<typename Lhs, typename Rhs>
|
|
|
|
|
-[[nodiscard]] constexpr bool operator>(const dense_map_iterator<Lhs> &lhs, const dense_map_iterator<Rhs> &rhs) noexcept {
|
|
|
|
|
- return rhs < lhs;
|
|
|
|
|
-}
|
|
|
|
|
-
|
|
|
|
|
-template<typename Lhs, typename Rhs>
|
|
|
|
|
-[[nodiscard]] constexpr bool operator<=(const dense_map_iterator<Lhs> &lhs, const dense_map_iterator<Rhs> &rhs) noexcept {
|
|
|
|
|
- return !(lhs > rhs);
|
|
|
|
|
-}
|
|
|
|
|
-
|
|
|
|
|
-template<typename Lhs, typename Rhs>
|
|
|
|
|
-[[nodiscard]] constexpr bool operator>=(const dense_map_iterator<Lhs> &lhs, const dense_map_iterator<Rhs> &rhs) noexcept {
|
|
|
|
|
- return !(lhs < rhs);
|
|
|
|
|
-}
|
|
|
|
|
-
|
|
|
|
|
template<typename It>
|
|
template<typename It>
|
|
|
class dense_map_local_iterator final {
|
|
class dense_map_local_iterator final {
|
|
|
template<typename>
|
|
template<typename>
|
|
@@ -217,6 +193,11 @@ public:
|
|
|
return {it[idx].element.first, it[idx].element.second};
|
|
return {it[idx].element.first, it[idx].element.second};
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ template<typename Other>
|
|
|
|
|
+ [[nodiscard]] constexpr bool operator==(const dense_map_local_iterator<Other> &other) const noexcept {
|
|
|
|
|
+ return offset == other.offset;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
[[nodiscard]] constexpr std::size_t index() const noexcept {
|
|
[[nodiscard]] constexpr std::size_t index() const noexcept {
|
|
|
return offset;
|
|
return offset;
|
|
|
}
|
|
}
|
|
@@ -226,11 +207,6 @@ private:
|
|
|
std::size_t offset{dense_map_placeholder_position};
|
|
std::size_t offset{dense_map_placeholder_position};
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
-template<typename Lhs, typename Rhs>
|
|
|
|
|
-[[nodiscard]] constexpr bool operator==(const dense_map_local_iterator<Lhs> &lhs, const dense_map_local_iterator<Rhs> &rhs) noexcept {
|
|
|
|
|
- return lhs.index() == rhs.index();
|
|
|
|
|
-}
|
|
|
|
|
-
|
|
|
|
|
} // namespace internal
|
|
} // namespace internal
|
|
|
/*! @endcond */
|
|
/*! @endcond */
|
|
|
|
|
|