diff options
Diffstat (limited to 'include/memory')
-rw-r--r-- | include/memory | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/include/memory b/include/memory index 4c12ad93ab863..f80d699fc0d4d 100644 --- a/include/memory +++ b/include/memory @@ -1571,7 +1571,10 @@ struct _LIBCPP_VISIBLE allocator_traits __construct_backward(allocator_type& __a, _Ptr __begin1, _Ptr __end1, _Ptr& __end2) { while (__end1 != __begin1) - construct(__a, _VSTD::__to_raw_pointer(--__end2), _VSTD::move_if_noexcept(*--__end1)); + { + construct(__a, _VSTD::__to_raw_pointer(__end2-1), _VSTD::move_if_noexcept(*--__end1)); + --__end2; + } } template <class _Tp> |