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

Published by Addison-Wesley Professional (December 10, 2004) © 2005

  • David Abrahams
  • Aleksey Gurtovoy
$47.99

  • A print text (hardcover or paperback) 
  • Free shipping
  • Also available for purchase as an ebook from all major ebook resellers, including InformIT.com

Simply put, a metaprogram is a program which generates or manipulates

program code. The ability to programmatically create software allows

programmers to work at a higher level of abstraction appropriate to the

problem domain, and allows the resulting code to be reconfigured without loss

of efficiency. 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 the excitement generated by these

capabilities among C++ experts has reached the community at large, their

practical application remains out-of-reach for most programmers. This book

provides the neccessary foundation to make template metaprogramming

practical for everyone.

At long last, this much-awaited book delivers practical metaprogramming into the hands of the everyday C++ programmer.

° Presents the C++ Metaprogramming Library (MPL), a framework of powerful tools providing unprecedented new capability to the C++ power-user.

° Bjarne Stroustrup gave the equivalent of a blank check to the authors--meaning that he would accept anything they wrote into his Series, given their overwhelming expertise in this domain.

° CD-ROM contains the entire Boost Library.

Preface.

Acknowledgments.

Making the Most of This Book.

1. Introduction.

    Getting Started.

    So What's a Metaprogram?

    Metaprogramming in the Host Language.

    Metaprogramming in C++.

    Why Metaprogramming?

    When Metaprogramming?

    Why a Metaprogramming Library?

2. Traits and Type Manipulation.

    Type Associations.

    Metafunctions.

    Numerical Metafunctions.

    Making Choices at Compile Time.

    A Brief Tour of the Boost Type Traits Library.

    Nullary Metafunctions.

    Metafunction Definition.

    History.

    Details.

    Exercises.

3. A Deeper Look at Metafunctions.

    Dimensional Analysis.

    Higher-Order Metafunctions.

    Handling Placeholders.

    More Lambda Capabilities.

    Lambda Details.

    Details.

    Exercises.

4. Integral Type Wrappers and Operations.

    Boolean Wrappers and Operations.

    Integer Wrappers and Operations.

     Exercises.

5. Sequences and Iterators.

    Concepts.

    Sequences and Algorithms.

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.


Need help? Get in touch

Video
Play
Privacy and cookies
By watching, you agree Pearson can share your viewership data for marketing and analytics for one year, revocable by deleting your cookies.

Pearson eTextbook: What’s on the inside just might surprise you

They say you can’t judge a book by its cover. It’s the same with your students. Meet each one right where they are with an engaging, interactive, personalized learning experience that goes beyond the textbook to fit any schedule, any budget, and any lifestyle.Â