The Standard Template Library (STL) has been a useful companion to C++ programmers since the 90s. Starting from concepts such as generic programming and value semantics, it has grown to support many useful scenarios. In this chapter, we will look at how STL supports functional programming in C++ 17 and see what some of the new features that have been introduced in C++ 20 are.
The following topics will be covered in this chapter:
- Using functional features from the <functional> header
- Using functional features from the <numeric> header
- Using functional features from the <algorithm> header
- std::optional and std::variant
- C++20 and the ranges library