From ab9d78f50ddba621f875cf5ceb9da3e20d0a04f5 Mon Sep 17 00:00:00 2001 From: Maxime Coste Date: Sun, 15 Nov 2020 08:57:19 +1100 Subject: Convert comparisons to spaceship operator --- src/utf8_iterator.hh | 19 ++----------------- 1 file changed, 2 insertions(+), 17 deletions(-) (limited to 'src/utf8_iterator.hh') diff --git a/src/utf8_iterator.hh b/src/utf8_iterator.hh index 618a44a9..4fd34f54 100644 --- a/src/utf8_iterator.hh +++ b/src/utf8_iterator.hh @@ -100,27 +100,12 @@ public: } bool operator==(const iterator& other) const noexcept { return m_it == other.m_it; } - bool operator!=(const iterator& other) const noexcept { return m_it != other.m_it; } - - bool operator< (const iterator& other) const noexcept { return m_it < other.m_it; } - bool operator<= (const iterator& other) const noexcept { return m_it <= other.m_it; } - - bool operator> (const iterator& other) const noexcept { return m_it > other.m_it; } - bool operator>= (const iterator& other) const noexcept { return m_it >= other.m_it; } + auto operator<=> (const iterator& other) const noexcept { return m_it <=> other.m_it; } template requires std::is_same_v or std::is_same_v bool operator==(const T& other) const noexcept { return m_it == other; } - - template - requires std::is_same_v or std::is_same_v - bool operator!=(const T& other) const noexcept { return m_it != other; } - - bool operator< (const BaseIt& other) const noexcept { return m_it < other; } - bool operator<= (const BaseIt& other) const noexcept { return m_it <= other; } - - bool operator> (const BaseIt& other) const noexcept { return m_it > other; } - bool operator>= (const BaseIt& other) const noexcept { return m_it >= other; } + auto operator<=> (const BaseIt& other) const noexcept { return m_it <=> other; } DifferenceType operator-(const iterator& other) const noexcept(noexcept_policy) { -- cgit v1.2.3