diff options
| author | Maxime Coste <mawww@kakoune.org> | 2020-11-11 21:43:27 +1100 |
|---|---|---|
| committer | Maxime Coste <mawww@kakoune.org> | 2021-11-21 09:44:56 +1100 |
| commit | fb4cef5b61639c507e6c5740cc5973d0d79ba673 (patch) | |
| tree | 751e533a39d9a51be6b8af9e4abe6af75df00e87 /src/utf8_iterator.hh | |
| parent | 04f11c2af3e0ecdc78df9800d381b2fdc46af3b7 (diff) | |
Replace std::enable_if with requires
Introduce some concepts for enum and flags handling, goodbye and
thanks for all the fish std::enable_if.
Diffstat (limited to 'src/utf8_iterator.hh')
| -rw-r--r-- | src/utf8_iterator.hh | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/utf8_iterator.hh b/src/utf8_iterator.hh index 81302ef9..618a44a9 100644 --- a/src/utf8_iterator.hh +++ b/src/utf8_iterator.hh @@ -109,12 +109,12 @@ public: bool operator>= (const iterator& other) const noexcept { return m_it >= other.m_it; } template<typename T> - std::enable_if_t<std::is_same<T, BaseIt>::value or std::is_same<T, Sentinel>::value, bool> - operator==(const T& other) const noexcept { return m_it == other; } + 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> - std::enable_if_t<std::is_same<T, BaseIt>::value or std::is_same<T, Sentinel>::value, bool> - operator!=(const T& other) const noexcept { return m_it != other; } + 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; } |
