[libcxx-commits] [libcxx] [libc++] Speed up vector<bool> copy/move-ctors [1/3] (PR #120132)

Louis Dionne via libcxx-commits libcxx-commits at lists.llvm.org
Mon Jan 20 08:55:40 PST 2025


https://github.com/ldionne approved this pull request.

LGTM with comments.

I do think we should go for the general-purpose optimizations in `std::copy` and friends for `vector<bool>::iterator`, however I think this patch is simple and doesn't preclude that optimization from being made. Worst case, if we think this adds any maintenance burden in the long run (unlikely), we could go back and call `std::copy(__v.begin(), __v.end(), begin())` instead in these call sites and remove the bit of logic related to `__external_cap_to_internal`.

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


More information about the libcxx-commits mailing list