[libcxx-commits] [libcxx] [libc++] Don't double-wrap iterators when bounded iterators are used (PR #182264)

Nikolas Klauser via libcxx-commits libcxx-commits at lists.llvm.org
Fri Feb 27 06:35:29 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>;
----------------
philnik777 wrote:

We do have some optimizations on `__wrap_iter`, but they already don't apply, since `__wrap_iter` is inside `__bounded_iter`. I can open issues for them, but I don't think they should block this.

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


More information about the libcxx-commits mailing list