diff options
| author | Maxime Coste <mawww@kakoune.org> | 2020-11-15 08:57:19 +1100 |
|---|---|---|
| committer | Maxime Coste <mawww@kakoune.org> | 2021-11-21 09:44:56 +1100 |
| commit | ab9d78f50ddba621f875cf5ceb9da3e20d0a04f5 (patch) | |
| tree | 776f88ea6befeab321ae8bd4d881e556a264916f /src/utf8_iterator.hh | |
| parent | fb4cef5b61639c507e6c5740cc5973d0d79ba673 (diff) | |
Convert comparisons to spaceship operator
Diffstat (limited to 'src/utf8_iterator.hh')
| -rw-r--r-- | src/utf8_iterator.hh | 19 |
1 files changed, 2 insertions, 17 deletions
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<typename T> requires std::is_same_v<T, BaseIt> or std::is_same_v<T, Sentinel> bool operator==(const T& other) const noexcept { return m_it == other; } - - template<typename T> - requires std::is_same_v<T, BaseIt> or std::is_same_v<T, Sentinel> - 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) { |
