Published December 29, 2017
If you want to become proficient at manipulating collections in C++, you have to know your STL algorithms. And in particular, you have to know your STL algorithms on sets
The algorithms on sets are less famous than the classical
algorithms but they are just as useful, if not more. The algorithms on sets include for example
(which is my favourite STL algorithm).
In this week’s video, you’ll see the algorithms on sets that the STL offers, what we mean by a set in the first place, and an example of their usage in code.
Indeed, I’m getting more used to the filming equipment to make videos so, as many of you suggested, the videos on Fluent C++ now contain some live coding examples!
Here, we see a practical case: a collection of sorted values has been modified, and we have two versions of it: the collection as it was before and the collection as it is now, after the modification. How do we find out which values have been added? Which have been removed?
With the set algorithms, it’s a walk in the park. Have a look by yourself:
- The importance of knowing the STL algorithms
- Know your algorithms: algos on sets
Share this post! Don’t want to miss out ?