Migrate from string view lite to std::string_view#495
Merged
Ghabry merged 6 commits intoEasyRPG:masterfrom Mar 20, 2025
Merged
Conversation
This removes string_view lite as C++17 supports string views natively. For convenience (and to make the replacement simpler) ToString helper function is kept. Unfortunately C++17 has no starts/ends_with, helpers were added for this.
Fixes liblcf build when targetting C++20 or newer
ghost
approved these changes
Mar 3, 2025
Due to a different conversion API used (std::from_chars) conversion from hex strings is not supported anymore. We do not use this feature so should be fine to remove it
Lack of support in clang and older gcc versions
ghost
approved these changes
Mar 12, 2025
carstene1ns
approved these changes
Mar 20, 2025
Member
carstene1ns
left a comment
There was a problem hiding this comment.
Maybe we could have gotten away with a using StringView = std::string_view, but of course this is cleaner. :D
Member
Author
We would have :D. Besides start and endwith the interface is the same ;) |
Also slightly improves the performance because the amounts of fetches is reduced.
This will still fail to compile when starts_with etc. is used but at least gives some hint.
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.
No description provided.