Skip to content

Commit 0c7e214

Browse files
committed
Call standard std::copy and update size explicitly in reserve
1 parent ce52b98 commit 0c7e214

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

libcxx/include/__vector/vector_bool.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -858,7 +858,8 @@ _LIBCPP_CONSTEXPR_SINCE_CXX20 void vector<bool, _Allocator>::reserve(size_type _
858858
this->__throw_length_error();
859859
vector __v(this->get_allocator());
860860
__v.__vallocate(__n);
861-
__v.__construct_at_end(this->begin(), this->end(), this->size());
861+
std::copy(__begin_, __begin_ + __external_cap_to_internal(size()), __v.__begin_);
862+
__v.__size_ = size();
862863
swap(__v);
863864
}
864865
}

0 commit comments

Comments
 (0)