C++ Template Metaprogramming sheds light on the most powerful idioms of today’s C++, at long last delivering practical metaprogramming tools and techniques. by Aleksey Gurtovoy, David Abrahams on the most powerful idioms of today’s C++, at long last delivering practical metaprogramming tools and techniques into . , English, Book edition: C++ template metaprogramming: concepts, tools, and techniques from boost and beyond / David Abrahams, Aleksey Gurtovoy. used to prepare the material for book’s Appendix C, “Compile-Time Performance” ;.

Author: Kazrakazahn JoJor
Country: Republic of Macedonia
Language: English (Spanish)
Genre: History
Published (Last): 2 October 2010
Pages: 113
PDF File Size: 3.85 Mb
ePub File Size: 9.95 Mb
ISBN: 162-8-15409-841-7
Downloads: 23397
Price: Free* [*Free Regsitration Required]
Uploader: Yotilar

Register your product to gain access to bonus material or receive a coupon. This eBook includes the following formats, accessible from your Account page after purchase:. EPUB The open industry format known for its reflowable content and usability on supported mobile devices. This eBook requires no passwords or activation to read. We customize your eBook by discreetly watermarking it with your name, making it uniquely yours.

Abrahams and Gurtovoy have written something close to a classic… marvelous fun to read… Read the complete book review by Jack J. Dobbs Journal, June 03, “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 metaprogrammint.

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.

A metaprogram is a abrshams that generates or manipulates program code. 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. 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. Download the Sample Chapter related to mmetaprogramming title. Download the sample pages includes Chapter 3 and Index. At the time it appeared to Dave to be nothing more than a curiosity, a charming but impractical hijacking of the template system to prove that you can write programs that execute at compile time.

He never suspected that one day he would see a role for metaprogramming in most of his day-to-day programming jobs. With the availability of tools to write and understand metaprograms at a high level, we’ve since found that using these techniques is not only practical, but easy, fun, and often astoundingly powerful. Despite the existence of numerous real systems built with template metaprogramming and the MPL, many people still consider metaprogramming to be other-worldly magic, and often as something to be avoided in day-to-day dagid code.


If you’ve never done any metaprogramming, it may not even have an obvious relationship to the work you do. With this book, we hope to lift the veil of mystery, so that you get an understanding not only of how metaprogramming is done, but also why and when. The best part is that while much of the mystery will have dissolved, we think you’ll still find enough magic left in the subject to stay as inspired about it as we are. The first few chapters of this book lay the conceptual foundation you’ll need for most everything else we cover, and chapters generally build on material that has come before.

That said, feel free to skip ahead for any reason—we’ve tried to make that possible by providing cross-references when we use terms introduced earlier on. Tdmplate 10, Domain-Specific Embedded Languages, is an exception to the rule that later chapters depend on earlier ones.

It focuses mostly on concepts, and only appears late gutrovoy the book because at that point you’ll have learned the tools and techniques to put Domain-Specific Embedded Languages into play in real code. If you only remember one chapter by the time you’re done, make it that one.

Near the end of many chapters, you’ll find a Details section that summarizes key ideas. We conclude most chapters metaprogrammlng exercises designed to help you develop both your programming and conceptual muscles.

Those marked with asterisks are expected to be more of a workout than the others. Not all exercises involve writing code—some could be considered “essay questions”—and you don’t have to complete them in order to move on to later chapters.

We do suggest you look through them, give a little thought to how you’d answer each one, and try your hand at one or two; it’s a great way to gain confidence with what you’ve just read.

Additional and updated material, including the inevitable errata, will appear on the book’s Web site: You’ll also find a place there to report any mistakes you might find. The libraries we present in this book go to great lengths to hide the problems trmplate less-than-perfect compilers, so it’s unlikely that you’ll have trouble with the examples we present here. Those with mostly conforming template implementations. On these compilers, the examples and libraries “just work.

Those that can be made to work, but require some workarounds in user code. Those that are too broken to use effectively for template metaprogramming. Appendix Gurtooy lists the compilers that are known to fall into each of these categories.

For those in category B, Appendix D refers to a list of portability idioms. These idioms have been applied to the copies of the book’s examples that appear on the accompanying CD, but to avoid distracting the majority of readers they don’t appear in the main text.


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

The CD also contains a portability table with a detailed report of how various compilers are doing with our examples. GCC is available free for most platforms, and recent versions have no problems handling the code we present here. Even if you have a relatively modern compiler from category A, it might be a good idea to grab a copy of GCC with which to cross-check your code.

Often the easiest temp,ate to decipher an inscrutable error message is to see what some other compiler has to say about your program. If you find yourself struggling with error messages as you try to do the exercises, you might metaprogranming to skip gutovoy and read the first two sections of Chapter 8, which discusses how to read and manage diagnostics.

Practical Programming By Example.

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

Download the Index file related to this title. Errata for this book can be found at: Get unlimited day access to over 30, books about UX design, leadership, project management, teams, agile aleksy, analytics, core programming, and so much more.

Add To My Wish List. Description Copyright Dimensions: Making the Most of This Book. So What’s a Metaprogram? Metaprogramming in the Host Language. Why a Metaprogramming Library? Traits and Type Manipulation. Making Choices at Compile Time. A Deeper Look at Metafunctions.

Integral Type Wrappers and Operations. Boolean Wrappers and Operations. Integer Wrappers and Operations.

Writing Your Own Sequence. Algorithms, Idioms, Reuse, and Abstraction. Algorithms in the MPL. Writing Your Own Algorithms. Views and Iterator Adaptors. Writing Your Own View. Debugging the Error Novel. Using Tools for Diagnostic Analysis. Member Function Pointers as Template Arguments.

The Curiously Recurring Template Pattern. Explicitly Managing the Overload Set. Goes a Long Way. The Boost Spirit Library.

An Introduction to Preprocessor Metaprogramming. Fundamental Abstractions of the Mrtaprogramming. The typename and template Keywords.

Making the Most of This Book The first few chapters of this book lay the conceptual foundation you’ll need for most everything else we cover, and chapters generally build on material that has come before.

Supplementary Material This book comes with a companion CD that supplies the following items in electronic form Sample code from the book. Boost libraries discussed in this metapfogramming that are not yet part of an official release. Index Download the Index file related to this title. Updates Errata Errata for this book can be found at: Unlimited one-month access with your purchase.

Request an Instructor or Media review copy.