Paperback: 352 pages
Publisher: Addison-Wesley Professional; 1 edition (February 23, 2001)
Product Dimensions: 7.4 x 0.9 x 9.1 inches
Shipping Weight: 1.4 pounds (View shipping rates and policies)
Average Customer Review: 4.4 out of 5 stars See all reviews (88 customer reviews)
Best Sellers Rank: #150,270 in Books (See Top 100 in Books) #89 in Books > Computers & Technology > Programming > Microsoft Programming > C & C++ Windows Programming #104 in Books > Computers & Technology > Programming > Languages & Tools > C & C++ > C++ #591 in Books > Textbooks > Computer Science > Programming Languages
Read this book and you may feel you've fallen down the hole into some sort of C++ Alice-in-Wonderland:"Isn't it nifty just how much you can do with functions... that not only don't do anything but don't even really exist at all?" p.36The title is a bit presumptuous; a more accurate title would be "Template Metaprogramming Stunts", since this book is primarily about tricks you can play with C++'s template mechanism.The author does also make a go at proposing a new concept of "policy-based class design" -- by which he means using templates intead of multiple inheritance to create combinatorial mixtures of behavior. This is interesting, but seems hard to apply beyond the cliches he considers (ex: smart pointers), so his argument reads like a well-intended but parochial graduate thesis, with dutiful gestures of respect to his mentors (ex: Scot Myers) and limited range of real-world application.The real meat of the book is his template techniques, which are ingenious -- if perverse, when seen from the standpoint of someone else trying to read and extend your code, or diagnose its arcane compiler errors. If you've ever had to work with other people on software, you may find his glib view of compiler errors disappointing. In many cases he relies on compiler errors to signal something more complex and semantic than the mere error would suggest. (If you're programmed much C++ you've surely experienced 10-line long STL template errors with a very simple underlying cause that is hard to discern from the error message. Learning to suss out what these mean is much of the sweat-work of learning C++.) I think this is simply that he's coming from the perspective that the interworkings of the language and the compiler are fascinating, and worth being a primary focus of study.