diff options
Diffstat (limited to 'libcxx/include/memory')
-rw-r--r-- | libcxx/include/memory | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/libcxx/include/memory b/libcxx/include/memory index 6f3fdd53ec3..4e3a6f814f1 100644 --- a/libcxx/include/memory +++ b/libcxx/include/memory @@ -1522,8 +1522,10 @@ struct _LIBCPP_TYPE_VIS_ONLY allocator_traits { ptrdiff_t _Np = __end1 - __begin1; if (_Np > 0) + { _VSTD::memcpy(__begin2, __begin1, _Np * sizeof(_Tp)); - __begin2 += _Np; + __begin2 += _Np; + } } template <class _Iter, class _Ptr> @@ -1551,8 +1553,10 @@ struct _LIBCPP_TYPE_VIS_ONLY allocator_traits typedef typename remove_const<_Tp>::type _Vp; ptrdiff_t _Np = __end1 - __begin1; if (_Np > 0) + { _VSTD::memcpy(const_cast<_Vp*>(__begin2), __begin1, _Np * sizeof(_Tp)); - __begin2 += _Np; + __begin2 += _Np; + } } template <class _Ptr> |