filter_view and transform_view have nested _Iterator_base:
|
class filter_view : public _Cached_position_t<forward_range<_Vw>, _Vw, filter_view<_Vw, _Pr>> {
|
|
// clang-format on
|
|
private:
|
|
/* [[no_unique_address]] */ _Vw _Range{};
|
|
/* [[no_unique_address]] */ _Semiregular_box<_Pr> _Pred{};
|
|
|
|
template <class _Traits> // TRANSITION, LWG-3289
|
|
struct _Iterator_base {};
|
|
// clang-format off
|
|
template <class _Traits>
|
|
requires _Has_member_iterator_category<_Traits>
|
|
struct _Iterator_base<_Traits> {
|
|
class transform_view : public view_interface<transform_view<_Vw, _Fn>> {
|
|
// clang-format on
|
|
private:
|
|
/* [[no_unique_address]] */ _Vw _Range{};
|
|
/* [[no_unique_address]] */ _Semiregular_box<_Fn> _Fun{};
|
|
|
|
template <bool _Const>
|
|
class _Sentinel;
|
|
|
|
template <class _Traits, class _Base> // TRANSITION, LWG-3289
|
|
struct _Iterator_base {};
|
|
// clang-format off
|
|
template <class _Traits, class _Base>
|
|
requires _Has_member_iterator_category<_Traits>
|
|
struct _Iterator_base<_Traits, _Base> {
|
This shadows the STL-wide _Iterator_base (which is very important because it powers iterator debugging):
|
#if _ITERATOR_DEBUG_LEVEL == 0
|
|
using _Container_base = _Container_base0;
|
|
using _Iterator_base = _Iterator_base0;
|
|
#else // _ITERATOR_DEBUG_LEVEL == 0
|
|
using _Container_base = _Container_base12;
|
|
using _Iterator_base = _Iterator_base12;
|
|
#endif // _ITERATOR_DEBUG_LEVEL == 0
|
I strongly believe that this shadowing is confusing and should be avoided by renaming the nested structs.
filter_viewandtransform_viewhave nested_Iterator_base:STL/stl/inc/ranges
Lines 853 to 864 in 2b4cf99
STL/stl/inc/ranges
Lines 1130 to 1144 in 2b4cf99
This shadows the STL-wide
_Iterator_base(which is very important because it powers iterator debugging):STL/stl/inc/xmemory
Lines 1234 to 1240 in 2b4cf99
I strongly believe that this shadowing is confusing and should be avoided by renaming the nested structs.