r237985 - in /trunk/libstdc++-v3: ChangeLog inc...
redi@gcc.gnu.org
redi@gcc.gnu.org
Mon Jul 4 14:52:00 GMT 2016
Author: redi
Date: Mon Jul 4 14:52:46 2016
New Revision: 237985
URL: https://gcc.gnu.org/viewcvs?rev=237985&root=gcc&view=rev
Log:
Fix std::vector's use of temporary objects
* include/bits/stl_vector.h (emplace(const_iterator, _Args&&...)):
Define inline. Forward to _M_emplace_aux.
(insert(const_iterator, value_type&&)): Forward to _M_insert_rval.
(_M_insert_rval, _M_emplace_aux): Declare new functions.
(_Temporary_value): New RAII type using allocator to construct/destroy.
(_S_insert_aux_assign): Remove.
(_M_insert_aux): Make non-variadic.
* include/bits/vector.tcc (insert(const_iterator, const value_type&)):
Use _Temporary_value.
(emplace(const_iterator, _Args&&...)): Remove definition.
(_M_insert_rval, _M_emplace_aux): Define.
(_M_insert_aux): Make non-variadic, stop using _S_insert_aux_assign.
(_M_fill_insert): Use _Temporary_value.
* testsuite/23_containers/vector/allocator/construction.cc: New test.
* testsuite/23_containers/vector/modifiers/insert_vs_emplace.cc:
Adjust expected results for emplacing an lvalue with reallocation.
* testsuite/23_containers/vector/check_construct_destroy.cc: Adjust
expected results to account for construction/destruction of temporary
using allocator.
Added:
trunk/libstdc++-v3/testsuite/23_containers/vector/allocator/construction.cc
Modified:
trunk/libstdc++-v3/ChangeLog
trunk/libstdc++-v3/include/bits/stl_vector.h
trunk/libstdc++-v3/include/bits/vector.tcc
trunk/libstdc++-v3/testsuite/23_containers/vector/check_construct_destroy.cc
trunk/libstdc++-v3/testsuite/23_containers/vector/modifiers/insert_vs_emplace.cc
trunk/libstdc++-v3/testsuite/backward/hash_set/check_construct_destroy.cc
More information about the Gcc-cvs
mailing list