An Introduction to Ranges and Algorithms

Learn about the design behind iterators and containers in this ranges and algorithm section.

We'll cover the following

So far, we’ve learned about the syntax and the mechanism of templates in C++, up to the latest version of the standard, C++20. This has equipped us with the necessary knowledge to write templates from simple forms to complex ones. Templates are the key to writing generic libraries. Even though we might not write such a library ourselves, we’d still be using one or more. In fact, the everyday code that we’re writing in C++ uses templates. And the main reason for that is that as modern C++ developers, we’re using the standard library, which is a library based on templates.

Overview of ranges and algorithms

However, the standard library is a collection of many libraries, such as the containers library, iterators library, algorithms library, numeric library, input/output library, filesystem library, regular expressions library, thread support library, utility libraries, and others. Overall, it’s a large library that could make the topic of at least an entire course. However, it’s worth exploring some key parts of the library to help us get a better understanding of some of the concepts and types we are or could be using regularly.

Get hands-on with 1200+ tech skills courses.