[libcxx-commits] [libcxx] [libc++] Simplify vector<bool>::__construct_at_end (Reopend) (PR #119632)
Peng Liu via libcxx-commits
libcxx-commits at lists.llvm.org
Mon Jan 20 12:18:40 PST 2025
================
@@ -852,7 +845,9 @@ _LIBCPP_CONSTEXPR_SINCE_CXX20 void vector<bool, _Allocator>::reserve(size_type _
this->__throw_length_error();
vector __v(this->get_allocator());
__v.__vallocate(__n);
- __v.__construct_at_end(this->begin(), this->end(), this->size());
+ // Ensure that the call to __construct_at_end(first, last, n) meets the precondition of n > 0
----------------
winner245 wrote:
That's right! The comment doesn't apply any more and the if condition is unnecessary.
https://github.com/llvm/llvm-project/pull/119632
More information about the libcxx-commits
mailing list