[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.
diff --git a/libcxx/docs/ReleaseNotes/23.rst b/libcxx/docs/ReleaseNotes/23.rst
index 4441a8a..9fcb0bbe 100644
--- a/libcxx/docs/ReleaseNotes/23.rst
+++ b/libcxx/docs/ReleaseNotes/23.rst
@@ -55,8 +55,8 @@
- 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 c1b27b8..576adfb 100644
--- a/libcxx/include/__iterator/wrap_iter.h
+++ b/libcxx/include/__iterator/wrap_iter.h
@@ -34,18 +34,17 @@
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>::difference_type difference_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>::difference_type difference_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 @@
}
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;