Challenge: Subrange Adaptor

Test the skills you learned in this section by implementing a custom subrange adaptor in this lesson.

We'll cover the following

Problem statement

Working and contributing to standard libraries (such as the ranges library) is an important factor in building a developer community. You are tasked with implementing a custom range adaptor subrange_view that splits a range into chunks of elements of a specific size. An overloaded pipe operator (|) is required to use this adaptor with other standard range adaptors.

Note: The implementation should meet the requirements of std::input_iterator and std::sentinel_for concepts of the ranges library.

Get hands-on with 1400+ tech skills courses.