File tree Expand file tree Collapse file tree 4 files changed +14
-0
lines changed
Expand file tree Collapse file tree 4 files changed +14
-0
lines changed Original file line number Diff line number Diff line change @@ -33,6 +33,10 @@ struct utf8_iterator {
3333 auto operator --(int ) noexcept -> self_type;
3434 friend auto operator ==(self_type, self_type) noexcept -> bool ;
3535 auto operator *() noexcept -> reference;
36+
37+ friend constexpr auto operator ==(self_type, const char8_t * ptr) noexcept {
38+ return *ptr == char8_t {0 };
39+ }
3640 };
3741
3842 const char8_t * ptr{nullptr };
Original file line number Diff line number Diff line change @@ -3057,6 +3057,10 @@ struct utf8_iterator {
30573057 auto operator--(int) noexcept -> self_type;
30583058 friend auto operator==(self_type, self_type) noexcept -> bool;
30593059 auto operator*() noexcept -> reference;
3060+
3061+ friend constexpr auto operator==(self_type, const char8_t * ptr) noexcept {
3062+ return *ptr == char8_t{0};
3063+ }
30603064 };
30613065
30623066 const char8_t * ptr{nullptr};
Original file line number Diff line number Diff line change @@ -3054,6 +3054,10 @@ struct utf8_iterator {
30543054 auto operator --(int ) noexcept -> self_type;
30553055 friend auto operator ==(self_type, self_type) noexcept -> bool ;
30563056 auto operator *() noexcept -> reference;
3057+
3058+ friend constexpr auto operator ==(self_type, const char8_t * ptr) noexcept {
3059+ return *ptr == char8_t {0 };
3060+ }
30573061 };
30583062
30593063 const char8_t * ptr{nullptr };
Original file line number Diff line number Diff line change @@ -41,4 +41,6 @@ static_assert(CTRE_TEST("y(?i)"));
4141static_assert (CTRE_TEST(" y(?ic)" ));
4242static_assert (CTRE_TEST(" y(?icsm)" ));
4343
44+ static_assert (CTRE_TEST(" (?i)Tom|Sawyer|Huckleberry|Finn" ));
45+
4446
You can’t perform that action at this time.
0 commit comments