Hello, my name is Jonathan Boccara. I'm your host on Fluent C++. I have been a C++ developer for 6 years, working for Murex which is a major software editor in the finance industry. My focus is on C++ and particularly how to write expressive code. I'm happy to take your feedback, don't hesitate to drop a comment on a post, follow me or get in touch directly !
Jonathan Boccara's blog
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
std::accumulate algorithms but they are just as useful, if not more. The algorithms on sets include for example
std::set_difference (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: