Introducing the Boost the next breakthrough in C++ programming Boost takes you far beyond the C++ Standard Library, making C++ programming more elegant, robust, and productive. Now, for the first time, a leading Boost expert systematically introduces the broad set of Boost libraries and teaches best practices for their use. Writing for intermediate-to-advanced C++ developers, Björn Karlsson briefly outlines all 58 Boost libraries, and then presents comprehensive coverage of 12 libraries you're likely to find especially useful. Karlsson's topics range from smart pointers and conversions to containers and data structures, explaining exactly how using each library can improve your code. He offers detailed coverage of higher-order function objects that enable you to write code that is more concise, expressive, and readable. He even takes you "behind the scenes" with Boost, revealing tools and techniques for creating your own generic libraries. Coverage includes The Boost libraries are proving so useful that many of them are planned for inclusion in the next version of the C++ Standard Library. Get your head start now , with Beyond the C++ Standard Library.
Any book hoping to introduce you to Boost can only ever hope to present a snapshot in time, as the Boost library is growing by a new library per month or so. Nevertheless, if you have a level of understanding of C++ sufficient to understand what the STL does then Boost becomes a natural evolution in your skillset and this book will give you a good general feel for what has been achieved.
And what has been achieved! Even if the only thing you took with you from reading this book were the smart_ptr library, your C++ programming would never be the same again. Scott Meyers' books - if you don't have these then read them first - make reference to smart_ptr in the context of discussing, well, smart pointers, and in particular the shortcomings of auto_ptr. Smart_ptr is the Velociraptor to auto_ptr's Compsognathus. With internal reference-counting, shared_ptr overcomes - among other things - the problems of managing copies of the same pointer which prevents one from using STL containers of smart pointers. That alone would earn its keep. However, smart_ptr also takes custom deleters. The consequences of this are beyond the scope of a review of a book in which smart_ptr is only one of a dozen libraries introduced, but suffice to say that a custom deleter can specify any behaviour to be executed when an object's lifetime expires, from freeing GDI resources to triggering events.
Another useful take-home are the static assertions in the Utility library. One useful rule in software engineering is to make any assumption into an assertion. Static assertions extend the principle to compile time, and provide a way to trigger compiler errors when user-defined conditions are violated - one example that I have in working code right now is to assert at compile time on the sizes of some key structures read from binary files to which an alteration would lead to data elsewhere becoming corrupted. If someone else on the team alters the structures, they get an immediate tantrum from the compiler which leads them to a comment saying why the size cannot be changed without having evil consequences.
The book covers twelve libraries: smart_ptr, Conversion, Utility, Operators, Regex, Any, Variant, Tuple, Bind, Lambda, Function and Signals. All of them will be useful to someone, and several may prove transformative to most developers. Apart from the two listed above, I could no longer get by without Regex and I plan to do ever more with Bind and Lambda. Several of the libraries, including Bind, take concepts that will be familiar from the STL and expand upon and generalise them, or resolve difficulties that plague users of the STL.
The book is not as easily and freely readable as Meyers' books on C++ and STL, but is perfectly clear and leaves you in no doubt at each section as to the utility of the subject library and the way it will benefit you on a day-to-day basis. Like Meyers, each section can be read independently and will do you for a (longish) train journey. You will need fairly strong C++ skills to get the most out of Boost, including an ease with templates and generic programming. This is also the case with the STL, so don't let it frighten you off, but the evolution in Boost requires one to go a bit further. When you have read the book you will understand the reasons for the development of each of the libraries, which might mean that you understand C++ better than you did and will probably mean that you will have ways to write code that is shorter and more expressive than you could before.
It may not be the only general introduction to Boost that is worth reading; it may not even be the best. It happens to be the one I started with a few years ago. All I can say, therefore, is that this book will introduce you to Boost and that it will do it well.
See also list: Effective C++: 55 Specific Ways to Improve Your Programs and Designs (3rd Edition) More Effective C++: 35 New Ways to Improve Your Programs and Designs Effective STL: 50 Specific Ways to Improve Your Use of the Standard Template Library Design Patterns: Elements of Reusable Object-Oriented Software Comment
A good introduction to the parts of Boost that are probably the most useful to the most programmers. What's particularly nice is that first the author shows you the problem, and how you might solve it without Boost, before showing you how Boost solves it and the advantages. So besides becoming familiar with Boost, you become more familiar with techniques for working around C++ deficiencies. Of course, if you're not comfortable with templates you may have trouble following along.
Simply a must-read for any serious C++ developer. It does not cover all of boost, but the topics it covers are very relevant and give you a good insight on what's in boost and the general usage patterns. Brilliant.