Skip to content

Commit fd9f6e2

Browse files
committed
Revert changes to vector
1 parent cdebfe5 commit fd9f6e2

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

libcxx/include/__vector/vector.h

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -737,7 +737,8 @@ _LIBCPP_CONSTEXPR_SINCE_CXX20 void
737737
vector<_Tp, _Allocator>::__swap_out_circular_buffer(__split_buffer<value_type, allocator_type&>& __v) {
738738
__annotate_delete();
739739
auto __new_begin = __v.__begin_ - (__end_ - __begin_);
740-
std::__uninitialized_allocator_relocate(__alloc(), __begin_, __end_, __new_begin);
740+
std::__uninitialized_allocator_relocate(
741+
__alloc(), std::__to_address(__begin_), std::__to_address(__end_), std::__to_address(__new_begin));
741742
__v.__begin_ = __new_begin;
742743
__end_ = __begin_; // All the objects have been destroyed by relocating them.
743744
std::swap(this->__begin_, __v.__begin_);
@@ -759,12 +760,14 @@ vector<_Tp, _Allocator>::__swap_out_circular_buffer(__split_buffer<value_type, a
759760

760761
// Relocate [__p, __end_) first to avoid having a hole in [__begin_, __end_)
761762
// in case something in [__begin_, __p) throws.
762-
std::__uninitialized_allocator_relocate(__alloc(), __p, __end_, __v.__end_);
763+
std::__uninitialized_allocator_relocate(
764+
__alloc(), std::__to_address(__p), std::__to_address(__end_), std::__to_address(__v.__end_));
763765
__v.__end_ += (__end_ - __p);
764766
__end_ = __p; // The objects in [__p, __end_) have been destroyed by relocating them.
765767
auto __new_begin = __v.__begin_ - (__p - __begin_);
766768

767-
std::__uninitialized_allocator_relocate(__alloc(), __begin_, __p, __new_begin);
769+
std::__uninitialized_allocator_relocate(
770+
__alloc(), std::__to_address(__begin_), std::__to_address(__p), std::__to_address(__new_begin));
768771
__v.__begin_ = __new_begin;
769772
__end_ = __begin_; // All the objects have been destroyed by relocating them.
770773

0 commit comments

Comments
 (0)