This section deals with a library that is proposed for the upcoming C++ standard, C++20. As of now, it is available at https://github.com/ericniebler/range-v3. Compiling these examples will require an updated compiler.
The future of STL and the ranges library
Limitations of the iterators in STL
Although the iterator and algorithm concepts in STL have quite a few good properties, they lack composability.
Let's say, we have some sort of a Warrior class with an ability and a level of ability, as implemented below:
enum class EAbility { Fencing, Archery };
class Warrior {
public:
EAbility ability_{};
int level_{};
std::string name_{};
};
Now, let's say we want to find the Warrior with the highest level of Archery in...