Summary
This chapter presented a number of motivations behind using Range views to construct algorithms. By using views, we can compose algorithms efficiently, and with a succinct syntax, using the pipe operator. You also learned what it means for a class to be a view and how to use range adaptors that turn ranges into views.
A view does not own its elements. Constructing a range view is required to be a constant time operation and all views are evaluated lazily. You have seen examples of how we can convert a container into a view, and how to materialize a view back into an owning container.
Finally, we covered a brief overview of the views that come with the standard library, and the likely future of ranges in C++.
This chapter is the last in the series about containers, iterators, algorithms, and ranges. We will now move on to memory management in C++.