[libcxx-commits] [libcxx] [libc++] Introduce _LIBCPP_ABI_BOUNDED_ITERATORS_IN_{STRING_VIEW, SPAN} (PR #143172)
Konstantin Varlamov via libcxx-commits
libcxx-commits at lists.llvm.org
Thu Jul 31 16:13:22 PDT 2025
var-const wrote:
> The main downside I see is that it makes it a lot easier to have a very weird ABI configuration.
Can you elaborate on this? I don't see anything strange about enabling bounded iterators for some containers but not others, especially given that we don't provide bounded iterators for every single applicable container.
> Is there any disagreement that in a perfect world there would be just two configurations throughout the library, namely bounded iterators and non-bounded iterators?
In a truly perfect world, all iterators would be bounded, I guess. Realistically, adoption is very important. If we add a new bounded iterator type, it will likely cause new traps in many projects, which for some may be a non-starter, and it's easier for them to fix their code if the new checks are an opt-in. Changing the hardening mode is too blunt a tool for this. I can also imagine projects having difficulties with only certain iterator types but not others (e.g. maybe a certain iterator type is widely used in a way that causes noticeable performance regressions).
https://github.com/llvm/llvm-project/pull/143172
More information about the libcxx-commits
mailing list