[PATCH] D48342: [libcxx] Optimize vectors construction of trivial types from an iterator range with const-ness mismatch.

Eric Fiselier via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Jul 4 04:02:50 PDT 2018


EricWF added a comment.

Are there any tests which actually exercise the new behavior?



================
Comment at: libcxx/include/memory:1665
+            (is_same<allocator_type, allocator<typename _VSTD::remove_const<_SourceTp>::type> >::value
+                || is_same<allocator_type, allocator<const _SourceTp> >::value
+                || !__has_construct<allocator_type, _DestTp*, const _SourceTp&>::value) &&
----------------
I'm not sure we should care about allocators for `T const`. The're all but an abomination. 


================
Comment at: libcxx/test/std/containers/sequences/vector/vector.cons/construct_iter_iter_different_value_type.pass.cpp:13
+// template <class InputIter> vector(InputIter first, InputIter last);
+
+// Initialize a vector with a different value type. Make sure initialization
----------------
Can this be folded into an existing test file for the constructor it's targeting?


https://reviews.llvm.org/D48342





More information about the cfe-commits mailing list