New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support for std::string_view
in sf::String
#2517
base: master
Are you sure you want to change the base?
Conversation
Adds support to sf::String to allow construction from std::string_view and variants thereof
I'll be more careful in the future. |
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## master #2517 +/- ##
==========================================
+ Coverage 27.13% 27.16% +0.03%
==========================================
Files 229 229
Lines 19652 19661 +9
Branches 4713 4714 +1
==========================================
+ Hits 5332 5341 +9
- Misses 13587 13602 +15
+ Partials 733 718 -15
... and 2 files with indirect coverage changes Continue to review full report in Codecov by Sentry.
|
std::string_view
in sf::String
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the PR!
I know it's for consistency, but the API surface for wchar_t
, etc. is getting quite big, for it being mainly a Windows oddity that surfaces when dealing with legacy APIs. u16string
is similarly rare.
Are types like std::wstring_view
actually being used?
The current implementation in origin:master has constructors for
string/wstring/u32string. I added string-view/wstring_view/u32string_view
to match those. I didn't see anything relevant for u16.
Are types like `std::wstring_view` actually being used?
I always thought it was used for large character sets like Hangul or Mandarin.
|
You probably mean Unicode in general, but most modern code uses either UTF-8 or UTF-32 to represent them, which can be encoded in various types in C++ (e.g.
I'm not saying |
Ignore my |
Description
Revision of #2451
This is in a new branch and up to date with the origin's master as of this post.
This PR is related to the issue #2445
Tasks
How to test this PR?
Test driver (modified to match changes in sf::Text):