-
Notifications
You must be signed in to change notification settings - Fork 1.6k
<xstring>: Use memmove in construction of basic_string when the source is a suitable contiguous range
#4073
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
<xstring>: Use memmove in construction of basic_string when the source is a suitable contiguous range
#4073
Conversation
<xstring>: Use memcpy in construction of basic_string when the source is a suitable contiguos range<xstring>: Use memcpy in construction of basic_string when the source is a suitable contiguous range
Such |
|
I have updated the PR description's criteria to match the code. |
This comment was marked as resolved.
This comment was marked as resolved.
Co-authored-by: Casey Carter <[email protected]>
Co-authored-by: Casey Carter <[email protected]>
<xstring>: Use memcpy in construction of basic_string when the source is a suitable contiguous range<xstring>: Use memmove in construction of basic_string when the source is a suitable contiguous range
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
55c7167 to
da953f8
Compare
|
Oh, I'm sorry for force-pushing because I misconfigured the git settings. |
|
I'm mirroring this to the MSVC-internal repo - please notify me if any further changes are pushed. |
|
Thanks for improving the performance of one of the STL's most important types! 🚀 😸 🎉 |
Fixes #2901.
Criteria:
EcharT(encoded character type, i.e.char,wchar_t,char8_t,char16_t,char32_t)Perhaps we can extend the criteria to
move_iteratorand unscoped enumeration types later.Clang's
__builtin_memcpydoesn't work when copying achararray to achar8_tarray in constant evaluation (nor does GCC's), so this PR isn't using it in the involved construction.The test
P1206R7_string_from_rangeis largely extended to cover some related contiguous ranges and character types. The originaltest_c_arrayseemed to be a duplicate oftest_copyable_views, so I changed it to properly cover built-in arrays.