mirror of https://github.com/llvm-mirror/libcxx
You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
------------------------------------------------------------------------
r315994 | ericwf | 2017-10-17 06:03:17 -0700 (Tue, 17 Oct 2017) | 18 lines
[libc++] Fix PR34898 - vector iterator constructors and assign method perform push_back instead of emplace_back.
Summary:
The constructors `vector(Iter, Iter, Alloc = Alloc{})` and `assign(Iter, Iter)` don't correctly perform EmplaceConstruction from the result of dereferencing the iterator. This results in them performing an additional and unneeded copy.
This patch addresses the issue by correctly using `emplace_back` in C++11 and newer.
There are also some bugs in our `insert` implementation, but those will be handled separately.
@mclow.lists We should probably merge this into 5.1, agreed?
Reviewers: mclow.lists, dlj, EricWF
Reviewed By: mclow.lists, EricWF
Subscribers: cfe-commits, mclow.lists
Differential Revision: https://reviews.llvm.org/D38757
------------------------------------------------------------------------
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/branches/release_50@318837 91177308-0d34-0410-b5e6-96231b3b80d8
|
8 years ago | |
|---|---|---|
| .. | ||
| test.support | 9 years ago | |
| test.workarounds | 9 years ago | |
| Counter.h | 9 years ago | |
| DefaultOnly.h | 12 years ago | |
| MoveOnly.h | 9 years ago | |
| allocators.h | 9 years ago | |
| any_helpers.h | 9 years ago | |
| archetypes.hpp | 9 years ago | |
| archetypes.ipp | 9 years ago | |
| asan_testing.h | 10 years ago | |
| assert_checkpoint.h | 9 years ago | |
| cmpxchg_loop.h | 10 years ago | |
| constexpr_char_traits.hpp | 9 years ago | |
| container_test_types.h | 8 years ago | |
| controlled_allocators.hpp | 9 years ago | |
| coroutine_types.h | 9 years ago | |
| count_new.hpp | 8 years ago | |
| counting_predicates.hpp | 10 years ago | |
| debug_mode_helper.h | 9 years ago | |
| deleter_types.h | 9 years ago | |
| demangle.h | 9 years ago | |
| disable_missing_braces_warning.h | 9 years ago | |
| emplace_constructible.h | 8 years ago | |
| experimental_any_helpers.h | 9 years ago | |
| external_threads.cpp | 9 years ago | |
| filesystem_dynamic_test_helper.py | 9 years ago | |
| filesystem_test_helper.hpp | 9 years ago | |
| hexfloat.h | 10 years ago | |
| is_transparent.h | 9 years ago | |
| min_allocator.h | 9 years ago | |
| msvc_stdlib_force_include.hpp | 9 years ago | |
| nasty_containers.hpp | 9 years ago | |
| nasty_macros.hpp | 9 years ago | |
| nothing_to_do.pass.cpp | 11 years ago | |
| platform_support.h | 9 years ago | |
| poisoned_hash_helper.hpp | 9 years ago | |
| private_constructor.hpp | 12 years ago | |
| propagate_const_helpers.h | 10 years ago | |
| rapid-cxx-test.hpp | 10 years ago | |
| set_windows_crt_report_mode.h | 9 years ago | |
| test_allocator.h | 9 years ago | |
| test_convertible.hpp | 10 years ago | |
| test_iterators.h | 9 years ago | |
| test_macros.h | 8 years ago | |
| test_memory_resource.hpp | 9 years ago | |
| test_workarounds.h | 9 years ago | |
| tracked_value.h | 9 years ago | |
| type_id.h | 9 years ago | |
| unique_ptr_test_helper.h | 9 years ago | |
| user_defined_integral.hpp | 10 years ago | |
| uses_alloc_types.hpp | 9 years ago | |
| variant_test_helpers.hpp | 9 years ago | |