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 the list of warriors.
If we were to use STL, the algorithm we'd use is std::max_element(), operating on level_, but as we only want to take the warriors with the ability of Archery into account, it gets tricky. Essentially, we want to compose a new algorithm out of a combination of std::copy_if() ...