Skip to content

Commit 46a345e

Browse files
author
Hana Dusíková
committed
added utf8_iterator rotated comparison
1 parent 6871ae9 commit 46a345e

File tree

3 files changed

+12
-0
lines changed

3 files changed

+12
-0
lines changed

include/ctre/utf8.hpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,10 @@ struct utf8_iterator {
2828
return lhs.ptr < lhs.end;
2929
}
3030

31+
constexpr friend bool operator!=(sentinel, const utf8_iterator & rhs) {
32+
return rhs.ptr < rhs.end;
33+
}
34+
3135
constexpr friend bool operator!=(const utf8_iterator & lhs, const utf8_iterator & rhs) {
3236
return lhs.ptr != rhs.ptr;
3337
}

single-header/ctre-unicode.hpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2487,6 +2487,10 @@ struct utf8_iterator {
24872487
return lhs.ptr < lhs.end;
24882488
}
24892489

2490+
constexpr friend bool operator!=(sentinel, const utf8_iterator & rhs) {
2491+
return rhs.ptr < rhs.end;
2492+
}
2493+
24902494
constexpr friend bool operator!=(const utf8_iterator & lhs, const utf8_iterator & rhs) {
24912495
return lhs.ptr != rhs.ptr;
24922496
}

single-header/ctre.hpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2484,6 +2484,10 @@ struct utf8_iterator {
24842484
return lhs.ptr < lhs.end;
24852485
}
24862486

2487+
constexpr friend bool operator!=(sentinel, const utf8_iterator & rhs) {
2488+
return rhs.ptr < rhs.end;
2489+
}
2490+
24872491
constexpr friend bool operator!=(const utf8_iterator & lhs, const utf8_iterator & rhs) {
24882492
return lhs.ptr != rhs.ptr;
24892493
}

0 commit comments

Comments
 (0)