-
-
Notifications
You must be signed in to change notification settings - Fork 21.1k
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
Core: Integrate CharStringT
#98439
base: master
Are you sure you want to change the base?
Core: Integrate CharStringT
#98439
Conversation
af8fe99
to
f232a29
Compare
f232a29
to
70f511f
Compare
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! This looks great to me
It very nearly matches the godot-cpp version, but with only minor changes (mostly const
-> constexpr
and inlining some stuff) that all make sense to me. I guess we'll need to copy those differences back to godot-cpp once this is merged :-)
70f511f
to
8ab46a5
Compare
8ab46a5
to
cb9b6a5
Compare
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.
Replacing CharString
and Char16String
with a template seems fine.
But there's no reason for wchar_t
(ambiguous type) and char32_t
versions, char8_t
also completely useless by its own (can be replacement for char8_t
, but what the point of doing so).
I'm not entirely certain of the original intent behind the |
Why do we want two different type that are exactly same, unless
Not sure why these exist in the |
I would say for similar reasons that we use |
I also don't really know the intention of
Could be. They end up creating an API discrepancy between Godot and godot-cpp, which isn't great. We probably should consider either (1) removing them from godot-cpp, or (2) adding them to Godot, so the APIs align. If we really do want to have them in godot-cpp for use with external APIs, they wouldn't cause any harm being in Godot as well. Adding them to Godot would probably mean also adding |
Taking heavy inspiration from the above PR, this aims to consolidate
CharString
andChar16String
with a common template core:CharStringT
. Not only does this have the benefit of code uniformity, but it also gives us access to new character string classes:CharWideString
&Char32String
(AlsoChar8String
whenchar8_t
is eventually supported). The only major changes from the godot-cpp implementation were making some functions inlined where possible & adding equality operators.