[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:19 PDT 2024
================
@@ -2060,6 +2058,21 @@ private:
#endif
}
+ // Disable ASan annotations and enable them again when going out of scope. It is assumed that the string is in a valid
+ // state at that point, so `size()` can be called safely.
+ struct [[__nodiscard__]] __annotation_guard {
----------------
ldionne wrote:
Let's introduce an actual `__scope_guard` and then use it here. It's going to be more general and it will make this code easier to understand.
https://github.com/llvm/llvm-project/pull/113453
More information about the libcxx-commits
mailing list