Namespaces
Variants
Views
Actions

Talk:cpp/container/vector/emplace

From cppreference.com

vector::emplace needs an iterator, not const_iterator Sakalisc (talk) 05:20, 15 December 2013 (PST)

it's `const_iterator` per §23.3.7.5[vector.modifiers] --Cubbi (talk) 10:35, 15 December 2013 (PST)
Egg on my face. It looks like the vector implementation I am using is wrong. Sorry for the false report. Sakalisc (talk) 12:15, 15 December 2013 (PST)

Complexity entries 2 through 5 are invalid; they look like copy/paste holdovers from the 'insert' page.

Thanks for spotting the error. Fixed. --Cubbi 03:24, 6 June 2012 (PDT)

[edit] emplace can move

> The element is constructed in-place, i.e. no copy or move operations are performed.

This is incorrect, emplace for std::vector and std::queue can and does move.