Skip to content
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

std::vector: Using emplace_back to replace push_back to improve performance #939

Conversation

nonwill
Copy link
Contributor

@nonwill nonwill commented Jan 26, 2025

As the title.

@AngusJohnson AngusJohnson merged commit baa7014 into AngusJohnson:main Jan 26, 2025
7 checks passed
@aismann
Copy link
Contributor

aismann commented Feb 1, 2025

@AngusJohnson
As I told long time ago great to add it now:
Replace Vector push_back() vs emplace_back() #175

@nonwill
Copy link
Contributor Author

nonwill commented Feb 2, 2025

push_back() vs emplace_back()

The difference between #93f346f and this one is that #93f346f is with less uising of std::move and std::forward which made emplace_back doing almost the same as push_back.

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