[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.
This commit is contained in:
Nikhil Kotikalapudi 2026-03-24 23:04:14 -04:00 committed by GitHub
parent eca7d833a6
commit feae3bc202
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 9 additions and 10 deletions

View File

@ -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
----------------------------

View File

@ -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>::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 @@ public:
}
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;