[libcxx-commits] [libcxx] [libc++] Don't double-wrap iterators when bounded iterators are used (PR #182264)
Louis Dionne via libcxx-commits
libcxx-commits at lists.llvm.org
Wed Feb 25 07:56:40 PST 2026
================
@@ -104,8 +104,8 @@ class vector {
// Users might provide custom allocators, and prior to C++20 we have no existing way to detect whether the allocator's
// pointer type is contiguous (though it has to be by the Standard). Using the wrapper type ensures the iterator is
// considered contiguous.
- using iterator = __bounded_iter<__wrap_iter<pointer> >;
- using const_iterator = __bounded_iter<__wrap_iter<const_pointer> >;
+ using iterator = __bounded_iter<pointer>;
----------------
ldionne wrote:
Can we double-check that we don't have any optimizations that rely on `__wrap_iter` specifically? Those should be fixed to use e.g. `contiguous_iterator` or similar to detect.
https://github.com/llvm/llvm-project/pull/182264
More information about the libcxx-commits
mailing list