Skip to content

Commit 57101ac

Browse files
committed
Call standard std::copy and update size explicitly in reserve
1 parent c22e4d5 commit 57101ac

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
@@ -851,7 +851,8 @@ _LIBCPP_CONSTEXPR_SINCE_CXX20 void vector<bool, _Allocator>::reserve(size_type _
851851
this->__throw_length_error();
852852
vector __v(this->get_allocator());
853853
__v.__vallocate(__n);
854-
__v.__construct_at_end(this->begin(), this->end(), this->size());
854+
std::copy(__begin_, __begin_ + __external_cap_to_internal(size()), __v.__begin_);
855+
__v.__size_ = size();
855856
swap(__v);
856857
}
857858
}

0 commit comments

Comments
 (0)