Optimize inserting value_type into std::vector
authorJonathan Wakely <jwakely@redhat.com>
Thu, 16 Jun 2016 12:42:21 +0000 (13:42 +0100)
committerJonathan Wakely <redi@gcc.gnu.org>
Thu, 16 Jun 2016 12:42:21 +0000 (13:42 +0100)
commit0ae207e94796488449b40fe83263ddcefb4d9479
treec21c54c01fa1e1f2b1e9694416e725c929a22523
parentf5e336b111def9f729b874fc1af3bddb73a3d612
Optimize inserting value_type into std::vector

* include/bits/stl_vector.h (vector::_S_insert_aux_assign): Define
new overloaded functions.
* include/bits/vector.tcc (vector::_M_insert_aux): Use new functions
to avoid creating a redundant temporary.
* testsuite/23_containers/vector/modifiers/insert_vs_emplace.cc: New
test.

From-SVN: r237526
libstdc++-v3/ChangeLog
libstdc++-v3/include/bits/stl_vector.h
libstdc++-v3/include/bits/vector.tcc
libstdc++-v3/testsuite/23_containers/vector/modifiers/insert_vs_emplace.cc [new file with mode: 0644]