Skip to content

Switch to emplace_back to avoid extra object #5291

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
Feb 3, 2024

Conversation

MKlimenko
Copy link
Contributor

In the following cases switching to .emplace_back() allows to simplify the code (e.g., avoid explicit std::make_tuple() call) or allows to get rid of an extra temporary object (e.g., .push_back("foo") will construct a temporary string and then move it, while .emplace_back("foo") will construct the string directly in the container.

@ggerganov ggerganov merged commit 52bb63c into ggml-org:master Feb 3, 2024
jordankanter pushed a commit to jordankanter/llama.cpp that referenced this pull request Mar 13, 2024
hodlen pushed a commit to hodlen/llama.cpp that referenced this pull request Apr 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants