Mastering the C++17 STL
Make full use of the standard library components in C++17
Pack Publishing 2017
Mastering C++17 STL by Arthur O’Dwyer is a book which describes design, API and best practices of the C++ STL. Author uses simple, but strict and technical language to describe one by one most important parts of the C++ standard library. Each chapter is devoted to one area. Their order makes reader feel, that each one fulfills and cooperates with the previous one.
Topics in the book include:
- smart pointers,
- regular expressions,
- filesystem support.
Each chapter stars by stating some typical programming problem (most have code examples). Next, author introduces reader to the STL mechanisms which solves that problem. Usually presented functionalities have multiple variants. Author skilfully signals their presence and advices when to use each alternative. An excellent example is the chapter about containers. Each of them, except for the general description, is presented in terms of cases where code will benefit the most.
The book is pleasant to read. At every step author sneaks in good points about potential optimizations that compiler can apply when STL is used. The legendary “composability” of standard library mechanisms is clearly visible in many places. An example would be iterators, which are a link between algorithms and containers. In general, author’s great knowledge and his admiration for the well-thought architecture of the standard library can be felt all the time.
When it comes to the subject which usually annoys me, book title, I can’t say that I’m very disappointed. “C++17” in the title is often used as a bait for the potential readers. In practice references to the particular standard are minimal. In the case of Arthur O’Dwyer’s book, it has to be clearly stated that it is a solid guide into the STL as a whole, not the C++17 additions. But wherever new standard introduced significant corrections and improvements, it is clearly emphasized with a side note.
Summing up, I believe that Mastering C ++ 17 STL is at least a highly recommended book for every programmer, both a beginner and an experienced engineer who wants to refresh or organize his existing knowledge. I recommend reading it cover to cover, because among the simple descriptions of STL resources you can find gems related to optimization or non-standard use.
What I liked about the book
- Book is very actionable with lot’s of real-world code examples.
- Author gives deep insight into the STL architecture.
- There are many optimization tips and good practices.
- Even experienced programmers will learn a lot new things.
What I didn't like about the book
- There are far less C++17 references that I expected.
- I missed the exercises after each chapter.