The motivation for the Ranges library
- Concepts that define requirements on iterators and ranges can now be better checked by the compiler and provide more help during development
- New overloads of all functions in the
<algorithm>header are constrained with the concepts just mentioned and accept ranges as arguments rather than iterator pairs
- Constrained iterators in the iterator header
- Range views, which make it possible to compose algorithms
This chapter will focus on the last item: the concept of views, which allow us to compose algorithms to avoid the unnecessary copying of data to owning containers. To fully understand the importance of this, let's begin by demonstrating the lack of composability within the algorithm library.