summaryrefslogtreecommitdiffstats
path: root/libcxx/include/algorithm
diff options
context:
space:
mode:
authorMarshall Clow <mclow.lists@gmail.com>2019-02-06 16:10:25 +0000
committerMarshall Clow <mclow.lists@gmail.com>2019-02-06 16:10:25 +0000
commitc8879ab2fd9565120e835abc84e0ad9f66bfd021 (patch)
tree89fa781875468f7e3d3d52f9e7f7e9db53819a5e /libcxx/include/algorithm
parentd7cb5b8a3304bd804c0e94e62c7a13610e158873 (diff)
downloadbcm5719-llvm-c8879ab2fd9565120e835abc84e0ad9f66bfd021.tar.gz
bcm5719-llvm-c8879ab2fd9565120e835abc84e0ad9f66bfd021.zip
Add a specialization for '__unwrap_iter' to handle const interators. This enables the 'memmove' optimization for std::copy, etc.
llvm-svn: 353311
Diffstat (limited to 'libcxx/include/algorithm')
-rw-r--r--libcxx/include/algorithm12
1 files changed, 12 insertions, 0 deletions
diff --git a/libcxx/include/algorithm b/libcxx/include/algorithm
index b52d445225b..7da753a490d 100644
--- a/libcxx/include/algorithm
+++ b/libcxx/include/algorithm
@@ -1610,6 +1610,18 @@ __unwrap_iter(__wrap_iter<_Tp*> __i)
return __i.base();
}
+template <class _Tp>
+inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_IF_NODEBUG
+typename enable_if
+<
+ is_trivially_copy_assignable<_Tp>::value,
+ const _Tp*
+>::type
+__unwrap_iter(__wrap_iter<const _Tp*> __i)
+{
+ return __i.base();
+}
+
#else
template <class _Tp>
OpenPOWER on IntegriCloud