REVIEW - The C++ Standard Library Extensions - A Tutorial and Reference


The C++ Standard Library Extensions

A Tutorial and Reference


Pete Becker


Pearson Education (2006)




Thomas Guest


November 2008



The standard C++ library is a fine thing but there are some notable omissions and weaknesses: there are no hashed containers, few smart pointers, no standard regular expression library; support for gluing functions and algorithms could be improved on; and so on. The first C++ Library Technical Report (TR1) addresses these issues and many more. In 2006 the TR1 library was approved by ISO, and you can already find TR1 implementations. Pete Becker's book provides a comprehensive and accurate reference guide for the TR1 library.

The book styles itself as the perfect companion to Josuttis' "The C++ Standard Library", and that's what I hoped for -- a book which would cut through the standardese and provide clear instructions on how I could benefit from TR1. In the main, it succeeds. There's plenty of example code, and there needs to be -- TR1 gives the standard C++ library a sizeable boost. The code is clearly written and described, and available for download from the author's website. The examples I tried (using GCC 4.01) worked, though I had to fiddle a little with include paths. Pete Becker has first-hand knowledge of implementing TR1, giving this book an authorative tone. I can imagine this book becoming the TR1 Book and I would certainly recommend it.

I do have some niggles, though. More attention could have been given to the layout. The code examples often break awkwardly across pages and some form of syntax highlighting would have made them more readable. I can't understand why the output from these programs was either omitted or buried in a paragraph of explanatory text. Code comments were abused throughout the book to provide a running commentary. E.g.

tuple<>t0;        // default constructor  tuplet2(3);  // element initialised to 3
I realise this is common practice in programming books, but I'd like to see authors and publishers find a better way to annotate code.

These are niggles, though. My only real complaint was that many of the examples failed to show the benefits of using TR1. Much of TR1 is designed to make C++ easier to use; it's easier to manage dynamically allocated objects, it's easier to bind function arguments, it's easier to wrap functions for use in standard algorithms. The examples showed how to get TR1 code compiling and linking, but sometimes failed to explain why.

Book cover image courtesy of Open Library.

Your Privacy

By clicking "Accept All Cookies" you agree ACCU can store cookies on your device and disclose information in accordance with our Privacy Policy and Cookie Policy.

By clicking "Share IP Address" you agree ACCU can forward your IP address to third-party sites to enhance the information presented on the site, and that these sites may store cookies on your device.