basic_zstring_view: preserve tail substr and backport contains - #665
Merged
Duncan Horn (dunhor) merged 1 commit intoAug 13, 2026
Conversation
Return basic_zstring_view from the one-argument substr overload while keeping arbitrary slices as basic_string_view. Backport contains below C++23 and cover both narrow and wide views. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 5697cd0e-cf83-4d94-9f72-4b8c79379229
Monroe Thomas (mmthomas)
marked this pull request as ready for review
August 13, 2026 17:10
Contributor
Author
|
Duncan Horn (@dunhor) David Machaj (@dmachaj) Jon Wiswall (@jonwis) — this is the focused follow-up to #635, limited to the |
Duncan Horn (dunhor)
approved these changes
Aug 13, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
basic_zstring_view::substr(pos)overload that returnsbasic_zstring_view, since a tail of a null-terminated view remains null-terminated.substr(pos, count)overload returningstd::basic_string_view, since an arbitrary slice may not be null-terminated.contains()overloads for earlier language modes, gated on__cpp_lib_string_contains.This is the focused, independently reviewable subset discussed in #635. The non-null variant and its traits design are intentionally excluded and can be considered separately.
Validation
witest.exe "[zstring_view]": 96 assertions passed.witest.cpplatest.exe "[zstring_view]": 98 assertions passed.