C++ ranges::ForwardRange, InputRange, OutputRange Introduction














































C++ ranges::ForwardRange, InputRange, OutputRange Introduction



In this series of articles on RANGES with C++, today we are going to see libraries of std::ranges::ForwardRange , std::ranges::InputRange and std::ranges::OutputRange
____________________________________________________________________________________

INTRODUCTION to RANGES LIBRARY HAS BEEN DONE IN MY FIRST ARTICLE OF RANGES LIBRARY

All the libraries defined below are included in the header <ranger> and <iterator>.


  • std::ranges::InputRange


Input Range returns the input iterator when ranges::begin is used.


       template<class C>
         concept InputRange = Range<C> && InputIterator<iterator_t<C>>;

  • std::ranges::ForwardRange


Forward Range returns the forward iterator when ranges::begin is used.


template<class C> concept ForwardRange = InputRange<C> && ForwardIterator<iterator_t<C>>;


  • std::ranges::OutputRange


Output Range returns the desired output iterator when ranges::begin is used.


template<class Ranges, class C> concept OutputRange = Range<Ranges> && OutputIterator<iterator_t<Ranges>, C>;



Comments