Chapter 11: A Few More Ideas

We've learned some useful techniques in this book, including optional values, containers, iterators, algorithms, smart pointers, and more. We've seen examples of these concepts in use, and we've had the opportunity to experiment and apply them to some small projects. Let's now apply these techniques to a few more practical ideas.

In this chapter, we cover the following recipes:

  • Create a trie class for search suggestions
  • Calculate the error sum of two vectors
  • Build your own algorithm: split
  • Leverage existing algorithms: gather
  • Remove consecutive whitespace
  • Convert numbers to words

Technical requirement

You can find the code files for this chapter on GitHub at https://github.com/PacktPublishing/CPP-20-STL-Cookbook/tree/main/chap11 ...

Get C++20 STL Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.