Skip to content

Commit

Permalink
Add missing '__to_address' calls
Browse files Browse the repository at this point in the history
  • Loading branch information
mclow committed Oct 9, 2024
1 parent dc374cc commit ec33a42
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions libcxx/include/vector
Original file line number Diff line number Diff line change
Expand Up @@ -1582,7 +1582,7 @@ vector<_Tp, _Allocator>::erase(const_iterator __position) {
// destroy the element at __p
__alloc_traits::destroy(__alloc(), std::__to_address(__p));
// move the rest down
(void) relocate(__p + 1, this->__end_, __p);
(void) relocate(std::__to_address(__p + 1), std::__to_address(this->__end_), std::__to_address(__p));
// update the end
this->__end_--;
__annotate_shrink(__old_size);
Expand Down Expand Up @@ -1647,7 +1647,7 @@ vector<_Tp, _Allocator>::insert(const_iterator __position, const_reference __x)
if constexpr (is_trivially_relocatable_v<_Tp> || is_nothrow_move_constructible_v<_Tp>) {
// Make space by trivially relocating everything
_ConstructTransaction __tx(*this, 1);
(void) relocate(std::__to_address(__p), std::__to_address(this->__end_), __p + 1);
(void) relocate(std::__to_address(__p), std::__to_address(this->__end_), std::__to_address(__p + 1));
// construct the new element (not assign!)
const_pointer __xr = pointer_traits<const_pointer>::pointer_to(__x);
if (std::__is_pointer_in_range(std::__to_address(__p), std::__to_address(__end_), std::addressof(__x)))
Expand Down Expand Up @@ -1687,7 +1687,7 @@ vector<_Tp, _Allocator>::insert(const_iterator __position, value_type&& __x) {
if constexpr (is_trivially_relocatable_v<_Tp> || is_nothrow_move_constructible_v<_Tp>) {
// Make space by trivially relocating everything
_ConstructTransaction __tx(*this, 1);
(void) relocate(std::__to_address(__p), std::__to_address(this->__end_), __p + 1);
(void) relocate(std::__to_address(__p), std::__to_address(this->__end_), std::__to_address(__p + 1));
// construct the new element (not assign!)
__alloc_traits::construct(this->__alloc(), std::__to_address(__p), std::forward<value_type>(__x));
++__tx.__pos_;
Expand Down Expand Up @@ -1722,7 +1722,7 @@ vector<_Tp, _Allocator>::emplace(const_iterator __position, _Args&&... __args) {
if constexpr (is_trivially_relocatable_v<_Tp> || is_nothrow_move_constructible_v<_Tp>) {
// Make space by trivially relocating everything
_ConstructTransaction __tx(*this, 1);
(void) relocate(std::__to_address(__p), std::__to_address(this->__end_), __p + 1);
(void) relocate(std::__to_address(__p), std::__to_address(this->__end_), std::__to_address(__p + 1));
// construct the new element
__alloc_traits::construct(this->__alloc(), std::__to_address(__p), std::forward<_Args>(__args)...);
++__tx.__pos_;
Expand Down

0 comments on commit ec33a42

Please sign in to comment.