[Home Page] - [Reviews Main] | |
|
Designing Components with the C++ STL by Breymann Recommended |
| ISBN: 0-201-17816-8 Publisher: Addison-Wesley Pages: 306pp Price: £29.95 |
| Categories: advanced c++ |
| Reviewed by Sean Corfield in Overload OL27 (Aug 1998) |
After the initial introduction of concepts, Breymann lays bare iterators in a compact but comprehensive manner, then moves on to deal with containers. In both cases, the interfaces are explained in detail and certain implementation details are considered, partly to shine light on aspects of the interface but mainly to provide a deeper understanding of how the iterators and containers perform their tasks.
The second, central, section of the book covers all the algorithms of STL in about 70 pages. By its nature, this section is almost strictly a reference manual since their are so many algorithms. Breymann provides intelligent commentary throughout, especially where several similar algorithms need clear explanation of their differences, e.g., the sorting and merging algorithms.
Moving on to the third section of the book, Breymann introduces various algorithms and containers that provide solutions to some of the annoying limitations of the STL specification. In each case he explains the benefits and drawbacks of the approach, illustrating each with clear code examples. A particularly good case in point is the chapter on 'Fast Associative Containers' which are implemented using hashing. Hash-based containers were omitted from the (draft) Standard C++ library mainly due to time constraints and the committee has been publically criticised for this omission. Without grinding any particular axe, Breymann provides full implementations of hash-based containers with intelligent commentary and analysis while conceding that no standard exists for these containers, therefore his are just examples.
In chapter 8, we move on to applications constructed on top of STL, cross-referencers, permuted index generators, thesaurus, matrices and so on. Some of these build on the raw STL, others on Breymann's own extensions to STL. Breymann shows how generic applications can be built that allow selection of implementations (using different STL-like containers) and discusses the performance tradeoffs involved. I was particularly impressed by chapter 11 which deals with data structures and algorithms for handling various types of graph (directed, undirected, cyclic, acyclic, weighted etc). Breymann manages to cram a lot of content into a seemingly tiny amount of pages yet the discussion, and code, make the solutions seem comprehensible to the point of simplicity.
Throughout the book, Breymann presents exercises - most with solutions given in the appendix - that test the reader's comprehension and are often non-trivial. In fact, the book scores highly on the integrity of its examples and exercises by dealing with complete programs that illustrate the concepts and components being described.
There are occasional technical errors (e.g., using 'InputIterator_type' in a template declaration followed by 'Input_iterator' within the body) but these are few and far between so readers are unlikely to be confused by them. The technical reviewers have clearly done a good job but with such a highly technical subject under discussion, one or two errors are bound to crawl by unnoticed.
To link to this review, please use the URL: http://www.accu.org/bookreviews/public/reviews/d/d002013.htm
Copyright © The Association of C & C++ Users 1998-2000. All rights reserved.