Updates
Latest Tweet
What's New?
Check out for latest innovation, a computer based training video collection
Like this Page
C++ Template Metaprogramming: Concepts, Tools, and Techniques from Boost and Beyond Review by wiredweird
Unique material
Abrahams and Gurtovoy address a distinctive and little-known set of C++ features: behaviors of the template mechanism that go far beyond swapping "double" for "float." In fact, Lisp-like recursion, arithmetic, and list-processing features, all executed at compile time, give the C++ typing subsystem all the power of a Turing machine - but without such nice debugging features.
The authors base most of their discussion on the open-source Boost Meta-programming library (MPL), perhaps the most widely known and highly developed usage of this capability. Most of the discussion patiently describes this exotic set of capabilities, giving the reader a clear idea of what the library does and some idea of how the library does it. I came away a bit uncertain about the authors' purpose, though. I didn't see enough detail in describing the primitive C++ mechanisms for a reader to go off and use those primitives in new ways - this largely discusses the MPL library elements as black boxes, without a lot of detail about how they work. But, if the intended reader was meant to incorporate an existing library (like MPL) into an application, I didn't see enough in the way of practical examples or motivation. It's nice that API elements exist for handling lists like - but why? In what context do such lists arise? What useful work does this tool perform? Or is it just an idea book for an obfuscated C contestant?
Unless you've mastered the user-unfriendly documentation for Boost MPL or other libraries mentioned here, this really is the only book on the topic. I wish it covered everyday basics a bit better, for example checking that some class in a template parameter is derived from some other class. I look forward to the next reference on the topic, one that goes over internals of the library more thoroughly, or one that gives more examples of practical applications.
-- wiredweird
Four stars - but that might have been different if there were another book on the topic to compare it to.