[libcxx-commits] [libcxx] [libc++] Simplify vector<bool>::__construct_at_end (Reopend) (PR #119632)

Louis Dionne via libcxx-commits libcxx-commits at lists.llvm.org
Mon Jan 20 11:53:50 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
----------------
ldionne wrote:

This precondition doesn't exist anymore, right? So we should be able to remove the comment, and maybe even the `if`?

https://github.com/llvm/llvm-project/pull/119632


More information about the libcxx-commits mailing list