Skip to content

Corrected the func definition for vector emplace#1808

Merged
colin-home merged 2 commits into
MicrosoftDocs:masterfrom
Panky-codes:vector-emplace-correction
Jan 4, 2020
Merged

Corrected the func definition for vector emplace#1808
colin-home merged 2 commits into
MicrosoftDocs:masterfrom
Panky-codes:vector-emplace-correction

Conversation

@Panky-codes

Copy link
Copy Markdown

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

@colin-home colin-home left a comment

Copy link
Copy Markdown
Contributor

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