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

Volodymyr Sapsai via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Jun 19 17:29:31 PDT 2018


vsapsai created this revision.
vsapsai added reviewers: mclow.lists, EricWF.
Herald added a subscriber: christof.

We already have a specialization that will use memcpy for construction
of trivial types from an iterator range like

  std::vector<int>(int *, int *);

But if we have const-ness mismatch like

  std::vector<int>(const int *, const int *);

we would use a slow path that copies each element individually. This change
enables the optimal specialization for const-ness mismatch. Fixes PR37574.

rdar://problem/40485845


https://reviews.llvm.org/D48342

Files:
  libcxx/include/memory
  libcxx/test/std/containers/sequences/vector/vector.cons/construct_iter_iter_different_value_type.pass.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D48342.152002.patch
Type: text/x-patch
Size: 4501 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20180620/5ba5301d/attachment.bin>


More information about the cfe-commits mailing list