Skip to content

Commit

Permalink
added utf8_iterator rotated comparison
Browse files Browse the repository at this point in the history
  • Loading branch information
Hana Dusíková committed Oct 18, 2020
1 parent 6871ae9 commit 46a345e
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 0 deletions.
4 changes: 4 additions & 0 deletions include/ctre/utf8.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,10 @@ struct utf8_iterator {
return lhs.ptr < lhs.end;
}

constexpr friend bool operator!=(sentinel, const utf8_iterator & rhs) {
return rhs.ptr < rhs.end;
}

constexpr friend bool operator!=(const utf8_iterator & lhs, const utf8_iterator & rhs) {
return lhs.ptr != rhs.ptr;
}
Expand Down
4 changes: 4 additions & 0 deletions single-header/ctre-unicode.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -2487,6 +2487,10 @@ struct utf8_iterator {
return lhs.ptr < lhs.end;
}

constexpr friend bool operator!=(sentinel, const utf8_iterator & rhs) {
return rhs.ptr < rhs.end;
}

constexpr friend bool operator!=(const utf8_iterator & lhs, const utf8_iterator & rhs) {
return lhs.ptr != rhs.ptr;
}
Expand Down
4 changes: 4 additions & 0 deletions single-header/ctre.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -2484,6 +2484,10 @@ struct utf8_iterator {
return lhs.ptr < lhs.end;
}

constexpr friend bool operator!=(sentinel, const utf8_iterator & rhs) {
return rhs.ptr < rhs.end;
}

constexpr friend bool operator!=(const utf8_iterator & lhs, const utf8_iterator & rhs) {
return lhs.ptr != rhs.ptr;
}
Expand Down

0 comments on commit 46a345e

Please sign in to comment.