Skip to content

Corrected the func definition for vector emplace #1808

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 2 commits into from
Jan 4, 2020
Merged

Corrected the func definition for vector emplace #1808

merged 2 commits into from
Jan 4, 2020

Conversation

Panky-codes
Copy link

The emplace member function of std::vector should take const_iterator and variadic list of arguments as their input for perfect forwarding link. This document had rvalue reference instead of variadic list of arguments. I also checked the std::vector implementation MSVC, it is now according to the changes proposed.
Probably why it still had rvalue reference is explained in this link link.

The emplace member function of std::vector should take const_iterator and variadic list of arguments as their input for perfect forwarding (https://en.cppreference.com/w/cpp/container/vector/emplace). This document had rvalue reference instead of variadic list of arguments. I also checked the std::vector implementation MSVC, it is now according to the changes proposed. 
Probably why it still had rvalue reference is explained in this link (https://stackoverflow.com/questions/4303513/push-back-vs-emplace-back).
@tfosmark tfosmark assigned colin-home and tfosmark and unassigned tfosmark Dec 30, 2019
@tfosmark tfosmark added the aq-pr-triaged Tracking label for the PR review team label Dec 30, 2019
Copy link
Contributor

@colin-home colin-home left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Panky-codes Thanks for the update. This has been wrong for a long time.

@colin-home colin-home merged commit e71c69e into MicrosoftDocs:master Jan 4, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
aq-pr-triaged Tracking label for the PR review team do-not-merge review-team-triage
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants