[libcxx-commits] [libcxx] [libc++] Simplify the implementation of string::{append, assign, assign_range} (PR #162254)
Louis Dionne via libcxx-commits
libcxx-commits at lists.llvm.org
Fri Oct 10 09:51:41 PDT 2025
================
@@ -698,6 +698,8 @@ __concatenate_strings(const _Allocator& __alloc,
__type_identity_t<basic_string_view<_CharT, _Traits> > __str1,
__type_identity_t<basic_string_view<_CharT, _Traits> > __str2);
+// This is true if we know for a fact that dereferencing the iterator won't access any part of the `string` we're
+// modifying if __addr_in_range(*it) returns false.
----------------
ldionne wrote:
The purpose of `__string_is_trivial_iterator`, as far as I remember and looking at https://reviews.llvm.org/D98573, is to identify iterators that basically don't throw in their operations (e.g. `operator++`). I don't know whether it still makes sense to check that or whether we can do better in our implementation to accommodate such iterators, but I think that we should document its purpose in a historically accurate way.
https://github.com/llvm/llvm-project/pull/162254
More information about the libcxx-commits
mailing list