[libcxx-commits] [libcxx] [libc++][NFC] Simplify the implementation of reserve() and shrink_to_fit() (PR #113453)

Louis Dionne via libcxx-commits libcxx-commits at lists.llvm.org
Wed Oct 23 11:00:20 PDT 2024


https://github.com/ldionne requested changes to this pull request.

This review paid off! Looks like there are many things we can improve / fix in the existing code. I think we should split this into a few PRs:

1. Introduce `__scope_guard` and simplify the `__annotate` stuff in the existing code.
2. Fix the bug with `shrink_to_fit` never increases capacity. This needs an additional test.
3. Remove the unnecessary capacity checks inside `reserve()`
4. Then, this patch.

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


More information about the libcxx-commits mailing list