The ranges library offers a variety of helpful new tools for the C++ programmer. All of them are useful, but many are particularly so for our functional programming needs.
But first, let's see how to set it up. To use the ranges library with C++ 17, you need to use the instructions from https://ericniebler.github.io/range-v3/. Then, you just need to include the all.hpp header file:
#include <range/v3/all.hpp>
As for C++ 20, you just need to include the <ranges> header since the library was included in the standard:
#include <ranges>
However, if you get a compilation error when trying out the previous line of code, don't be surprised. At the time of writing, the latest version of g++ is 9.1, but the ranges library hasn't yet been included in the standard. Due to its size, the implementations are expected to be quite...