Add a specialization for '__unwrap_iter' to handle const interators. This enables the 'memmove' optimization for std::copy, etc.
llvm-svn: 353311
diff --git a/libcxx/include/algorithm b/libcxx/include/algorithm
index b52d445..7da753a 100644
--- a/libcxx/include/algorithm
+++ b/libcxx/include/algorithm
@@ -1610,6 +1610,18 @@
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>