diff --git a/include/boost/range/const_iterator.hpp b/include/boost/range/const_iterator.hpp index 727fdad05..6b3fc0acd 100644 --- a/include/boost/range/const_iterator.hpp +++ b/include/boost/range/const_iterator.hpp @@ -23,6 +23,9 @@ #include #include #include +#if __cpp_lib_ranges >= 201911L +# include +#endif namespace boost { @@ -40,6 +43,20 @@ struct range_const_iterator_helper : extract_const_iterator {}; +////////////////////////////////////////////////////////////////////////// +// common_range +////////////////////////////////////////////////////////////////////////// + +#if __cpp_lib_ranges >= 201902L + +template< std::ranges::common_range C > +struct range_const_iterator_helper< C > +{ + typedef std::ranges::iterator_t< C const > type; +}; + +#endif + ////////////////////////////////////////////////////////////////////////// // pair ////////////////////////////////////////////////////////////////////////// diff --git a/include/boost/range/mutable_iterator.hpp b/include/boost/range/mutable_iterator.hpp index b92466667..d2fe449df 100644 --- a/include/boost/range/mutable_iterator.hpp +++ b/include/boost/range/mutable_iterator.hpp @@ -23,6 +23,9 @@ #include #include #include +#if __cpp_lib_ranges >= 201902L +# include +#endif namespace boost { @@ -42,6 +45,20 @@ struct range_mutable_iterator BOOST_DEDUCED_TYPENAME remove_reference::type> {}; +////////////////////////////////////////////////////////////////////////// +// common_range +////////////////////////////////////////////////////////////////////////// + +#if __cpp_lib_ranges >= 201902L + +template< std::ranges::common_range C > +struct range_mutable_iterator< C > +{ + typedef std::ranges::iterator_t< C > type; +}; + +#endif + ////////////////////////////////////////////////////////////////////////// // pair //////////////////////////////////////////////////////////////////////////