diff --git a/libcxx/include/__iterator/insert_iterator.h b/libcxx/include/__iterator/insert_iterator.h --- a/libcxx/include/__iterator/insert_iterator.h +++ b/libcxx/include/__iterator/insert_iterator.h @@ -14,6 +14,7 @@ #include <__iterator/iterator.h> #include <__iterator/iterator_traits.h> #include <__memory/addressof.h> +#include <__ranges/access.h> #include <__utility/move.h> #include @@ -36,8 +37,12 @@ _LIBCPP_SUPPRESS_DEPRECATED_POP protected: _Container* container; - typename _Container::iterator iter; // FIXME: `ranges::iterator_t` in C++20 mode -public: +#if _LIBCPP_STD_VER > 17 + ranges::iterator_t<_Container> iter; +#else + typename _Container::iterator iter; +#endif + public: typedef output_iterator_tag iterator_category; typedef void value_type; #if _LIBCPP_STD_VER > 17