Add a specialization for '__unwrap_iter' to handle const interators. This enables the 'memmove' optimization for std::copy, etc.

llvm-svn: 353311
This commit is contained in:
Marshall Clow 2019-02-06 16:10:25 +00:00
parent d7cb5b8a33
commit c8879ab2fd
1 changed files with 12 additions and 0 deletions

View File

@ -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>