[libcxx-commits] [libcxx] feae3bc - [libc++] Remove non-standard member type iterator_type from __wrap_iter (#186871)

via libcxx-commits libcxx-commits at lists.llvm.org
Tue Mar 24 20:04:19 PDT 2026


Author: Nikhil Kotikalapudi
Date: 2026-03-25T11:04:14+08:00
New Revision: feae3bc202cedbc1e83201eb8ea147f1a7729cd3

URL: https://github.com/llvm/llvm-project/commit/feae3bc202cedbc1e83201eb8ea147f1a7729cd3
DIFF: https://github.com/llvm/llvm-project/commit/feae3bc202cedbc1e83201eb8ea147f1a7729cd3.diff

LOG: [libc++] Remove non-standard member type iterator_type from __wrap_iter (#186871)

Resolves #186801 
Removed the non-standard member type `iterator_type` from `__wrap_iter`.
This member exposed the underlying iterator type, and its removal
prevents users from relying on the implementation detail.

Added: 
    

Modified: 
    libcxx/docs/ReleaseNotes/23.rst
    libcxx/include/__iterator/wrap_iter.h

Removed: 
    


################################################################################
diff  --git a/libcxx/docs/ReleaseNotes/23.rst b/libcxx/docs/ReleaseNotes/23.rst
index 4441a8aed198c..9fcb0bbe98303 100644
--- a/libcxx/docs/ReleaseNotes/23.rst
+++ b/libcxx/docs/ReleaseNotes/23.rst
@@ -55,8 +55,8 @@ Deprecations and Removals
 - The ``std::launch::any`` enumerator that was accidentally provided as an extension is now deprecated.
   It will be removed in LLVM 25.
 
-- ``__wrap_iter``'s (iterator type for ``array``, ``span``, ``string``, ``string_view`` and ``vector``) ``base()``
-  method has been removed as it was non-standard.
+- In ``__wrap_iter`` (iterator wrapper type for ``array``, ``span``, ``string``, ``string_view`` and ``vector``), 
+  the ``base()`` method and ``iterator_type`` member type have been removed as they are non-standard.
 
 Potentially breaking changes
 ----------------------------

diff  --git a/libcxx/include/__iterator/wrap_iter.h b/libcxx/include/__iterator/wrap_iter.h
index c1b27b8242cd9..576adfbce3841 100644
--- a/libcxx/include/__iterator/wrap_iter.h
+++ b/libcxx/include/__iterator/wrap_iter.h
@@ -34,18 +34,17 @@ _LIBCPP_BEGIN_NAMESPACE_STD
 template <class _Iter>
 class __wrap_iter {
 public:
-  typedef _Iter iterator_type;
-  typedef typename iterator_traits<iterator_type>::value_type value_type;
-  typedef typename iterator_traits<iterator_type>::
diff erence_type 
diff erence_type;
-  typedef typename iterator_traits<iterator_type>::pointer pointer;
-  typedef typename iterator_traits<iterator_type>::reference reference;
-  typedef typename iterator_traits<iterator_type>::iterator_category iterator_category;
+  typedef typename iterator_traits<_Iter>::value_type value_type;
+  typedef typename iterator_traits<_Iter>::
diff erence_type 
diff erence_type;
+  typedef typename iterator_traits<_Iter>::pointer pointer;
+  typedef typename iterator_traits<_Iter>::reference reference;
+  typedef typename iterator_traits<_Iter>::iterator_category iterator_category;
 #if _LIBCPP_STD_VER >= 20
   typedef contiguous_iterator_tag iterator_concept;
 #endif
 
 private:
-  iterator_type __i_;
+  _Iter __i_;
 
   friend struct pointer_traits<__wrap_iter<_Iter> >;
 
@@ -103,7 +102,7 @@ class __wrap_iter {
   }
 
 private:
-  _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 explicit __wrap_iter(iterator_type __x) _NOEXCEPT : __i_(__x) {}
+  _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 explicit __wrap_iter(_Iter __x) _NOEXCEPT : __i_(__x) {}
 
   template <class _Up>
   friend class __wrap_iter;


        


More information about the libcxx-commits mailing list