C++ Template Metaprogramming: Concepts, Tools, and Techniques from Boost and Beyond

Front Cover
Pearson Education, Dec 10, 2004 - Computers - 400 pages

C++ Template Metaprogramming sheds light on the most powerful idioms of today's C++, at long last delivering practical metaprogramming tools and techniques into the hands of the everyday programmer.

A metaprogram is a program that generates or manipulates program code. Ever since generic programming was introduced to C++, programmers have discovered myriad "template tricks" for manipulating programs as they are compiled, effectively eliminating the barrier between program and metaprogram. While excitement among C++ experts about these capabilities has reached the community at large, their practical application remains out of reach for most programmers. This book explains what metaprogramming is and how it is best used. It provides the foundation you'll need to use the template metaprogramming effectively in your own work.

This book is aimed at any programmer who is comfortable with idioms of the Standard Template Library (STL). C++ power-users will gain a new insight into their existing work and a new fluency in the domain of metaprogramming. Intermediate-level programmers who have learned a few advanced template techniques will see where these tricks fit in the big picture and will gain the conceptual foundation to use them with discipline. Programmers who have caught the scent of metaprogramming, but for whom it is still mysterious, will finally gain a clear understanding of how, when, and why it works. All readers will leave with a new tool of unprecedented power at their disposal—the Boost Metaprogramming Library.

Note: CD materials are only available with the print edition.

 

What people are saying - Write a review

We haven't found any reviews in the usual places.

Contents

Preface
Making the Most of This Book
Traits and Type Manipulation
A Deeper Look at Metafunctions
Integral Type Wrappers and Operations
Sequences and Iterators
Algorithms
Views and Iterator Adaptors
Crossing the CompileTimeRuntime Boundary
DomainSpecific Embedded Languages
Appendix A An Introduction to Preprocessor
Appendix B The typename and template Keywords
CompileTime Performance
MPL Portability Summary
A DSEL Design Walkthrough
Copyright

Diagnostics

Common terms and phrases

About the author (2004)

David Abrahams is a founding member and moderator of the Boost C++ library development group. Dave has been an ANSI/ISO C++ committee member since 1996, where he is best known for contributing a theory, specification, and implementation of exception handling for the C++ standard library. His company, Boost Consulting, provides Boost-related support and development services and professional training in the art of software construction.

Aleksey Gurtovoy is a technical lead for MetaCommunications and a contributing member of the Boost C++ community. Aleksey is the original author of the Boost Metaprogramming Library. He has been working with C++ since 1993, and holds a M.S. degree in computer science from Krasnoyarsk Technical State University, Russia.

Bibliographic information