Skip to content

CString tidy cleanup and rvalue methods #8718

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

Merged
merged 1 commit into from
May 9, 2025
Merged

CString tidy cleanup and rvalue methods #8718

merged 1 commit into from
May 9, 2025

Conversation

pixelflinger
Copy link
Collaborator

We add rvalue version of append/insert/replace so that calling those on a temporary yields to a temporary.

Also add string literal versions of those so that we can append/insert/replace a literal without allocation, e.g.:

CString foo = CString{ bar }.append("baz");

This will not end-up creating a temporary CString for "baz".

@pixelflinger pixelflinger added the internal Issue/PR does not affect clients label May 8, 2025
We add rvalue version of append/insert/replace so that calling
those on a temporary yields to a temporary.

Also add string literal versions of those so that we can 
append/insert/replace a literal without allocation, e.g.:

`CString foo = CString{ bar }.append("baz");`

This will not end-up creating a temporary CString for "baz".
@pixelflinger pixelflinger merged commit 5a5168a into main May 9, 2025
16 checks passed
@pixelflinger pixelflinger deleted the ma/cstring branch May 9, 2025 23:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
internal Issue/PR does not affect clients
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants