C++ Template Metaprogramming
Concepts, Tools, and Techniques from Boost and Beyond [With CD-ROM]
Elsewhere $103 $78.88 Save $24.12 (23%)
Free shipping Australia wide
||Price Checked Time
||Their Price in AUD
You save $24.96
||2 days ago
You save $4.48
Order now for Christmas delivery
|Format: ||Paperback, 373 pages|
|Other Information: ||Illustrations|
|Published In: ||United States, 10 December 2004|
"Abrahams and Gurtovoy have written something close to a classic… marvelous fun to read… "
Read the complete book review by Jack J. Woehr, Dr. Dobbs Journal, June 03, 2005
"If you' re like me, you' re excited by what people do with template metaprogramming (TMP) but are frustrated at the lack of clear guidance and powerful tools. Well, this is the book we' ve been waiting for. With help from the excellent Boost Metaprogramming Library, David and Aleksey take TMP from the laboratory to the workplace with readable prose and practical examples, showing that "compile-time STL" is as able as its runtime counterpart. Serving as a tutorial as well as a handbook for experts, this is the book on C++ template metaprogramming."
-Chuck Allison, Editor, "The C++ Source "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 withidioms 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.The companion CD-ROM contains all Boost C++ libraries, including the Boost Metaprogramming Library and its reference documentation, along with all of the book' s sample code and extensive supplementary material.
Table of Contents
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. Iterators. Iterator Concepts. Sequence Concepts. Sequence Equality. Intrinsic Sequence Operations. Sequence Classes. Integral Sequence Wrappers. Sequence Derivation. Writing Your Own Sequence. Details. Exercises. 6. Algorithms. Algorithms, Idioms, Reuse, and Abstraction. Algorithms in the MPL. Inserters. Fundamental Sequence Algorithms. Querying Algorithms. Sequence Building Algorithms. Writing Your Own Algorithms. Details. Exercises. 7. Views and Iterator Adaptors. A Few Examples. View Concept. Iterator Adaptors. Writing Your Own View. History. Exercises. 8. Diagnostics. Debugging the Error Novel. Using Tools for Diagnostic Analysis. Intentional Diagnostic Generation. History. Details. Exercises. 9. Crossing the Compile-Time/Runtime Boundary. for each. Implementation Selection. Object Generators. Structure Selection. Class Composition. (Member) Function Pointers as Template Arguments. Type Erasure. The Curiously Recurring Template Pattern. Explicitly Managing the Overload Set. The "sizeof Trick". Summary. Exercises. 10. Domain-Specific Embedded Languages. A Little Language. Goes a Long Way. DSLs, Inside Out. C++ as the Host Language. Blitz++ and Expression Templates. General-Purpose DSELs. The Boost Spirit Library. Summary. Exercises. 11. A DSEL DesignWalkthrough. Finite State Machines. Framework Design Goals. Framework Interface Basics. Choosing a DSL. Implementation. Analysis. Language Directions. Exercises. Appendix A. An Introduction to Preprocessor Metaprogramming. Motivation. Fundamental Abstractions of the Preprocessor. Preprocessor Library Structure. Preprocessor Library Abstractions. Exercise. Appendix B. The typename and template Keywords. The Issue. The Rules. Appendix C. Compile-Time Performance. The Computational Model. Managing Compilation Time. The Tests. Appendix D. MPL Portability Summary. Bibliography. Index.
Simply put, a metaprogram is a program which generates or manipulatesprogram code. The ability to programmatically create software allowsprogrammers to work at a higher level of abstraction appropriate to theproblem domain, and allows the resulting code to be reconfigured without lossof efficiency. Ever since generic programming was introduced to C++,programmers have discovered myriad "template tricks" for manipulatingprograms *as they are compiled*, effectively eliminating the barrier betweenprogram and metaprogram. While the excitement generated by thesecapabilities among C++ experts has reached the community at large, theirpractical application remains out-of-reach for most programmers. This bookprovides the neccessary foundation to make template metaprogrammingpractical for everyone.
About the Author
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.
Addison-Wesley Educational Publishers Inc|
23.47 x 18.8 x 1.85 centimetres (0.68 kg) |