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

Valutazione media 3,91
( su 78 valutazioni fornite da Goodreads )
 
9780321227256: C++ Template Metaprogramming: Concepts, Tools, and Techniques from Boost and Beyond

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 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.

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.


Le informazioni nella sezione "Riassunto" possono far riferimento a edizioni diverse di questo titolo.

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.



Excerpt. © Reprinted by permission. All rights reserved.:

In 1998 Dave had the privilege of attending a workshop in Generic Programming at Dagstuhl Castle in Germany. Near the end of theworkshop, a very enthusiastic Kristof Czarnecki and Ullrich Eisenecker (of Generative Programming fame) passed out a few pages of C++ source code that they billed as a complete Lisp implementation built out of C++ templates. 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. In many ways, that collection of templates was the precursor to the Boost Metaprogramming Library (MPL): It may have been the first library designed to turn compile-time C++ from an ad hoc collection of "template tricks" into an example of disciplined and readable software engineering. 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 production 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.

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. 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.

Chapter 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 in 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. These sections usually add new material that deepens the earlier discussion,* so even if you are inclined to skim them the first time through, we suggest you refer back to them later.

We conclude most chapters with 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.

Supplementary Material

This book comes with a companion CD that supplies the following items in electronic form

  • Sample code from the book.
  • A release of the Boost C++ libraries. Boost has become known for high-quality, peer-reviewed, portable, generic, and freely reusable C++ libraries. We make extensive use of one Boost library throughout the book—the Boost Metaprogramming Library (MPL)—and we discuss several others.
  • A complete MPL reference manual, in HTML and PDF form.
  • Boost libraries discussed in this book that are not yet part of an official release.

The index.html file at the top level of the CD will provide you with a convenient guide to all of its contents. Additional and updated material, including the inevitable errata, will appear on the book's Web site: http://www.boost-consulting.com/mplbook. You'll also find a place there to report any mistakes you might find.

Trying It Out

To compile any of the examples, just put the CD's boost 1 32 0/ directory into your compiler's #include path.

The libraries we present in this book go to great lengths to hide the problems of less-than-perfect compilers, so it's unlikely that you'll have trouble with the examples we present here. That said, we divide C++ compilers roughly into three categories.

      A. Those with mostly conforming template implementations. On these compilers, the examples and libraries "just work." Almost anything released since 2001, and a few compilers released before then, fall into this category.
      B. Those that can be made to work, but require some workarounds in user code.
      C. Those that are too broken to use effectively for template metaprogramming.

Appendix D 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.

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 way 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 want to skip ahead and read the first two sections of Chapter 8, which discusses how to read and manage diagnostics.

And now, on to C++ Template Metaprogramming!

— Dave and Aleksey

* We borrowed this idea from Andrew Koenig and Barbara Moo's Accelerated C++: Practical Programming By Example.



0321227255P12142004

Le informazioni nella sezione "Su questo libro" possono far riferimento a edizioni diverse di questo titolo.

I migliori risultati di ricerca su AbeBooks

1.

David Abrahams, Aleksey Gurtovoy
Editore: Pearson Education (US), United States (2005)
ISBN 10: 0321227255 ISBN 13: 9780321227256
Nuovi Paperback Quantità: 1
Da
The Book Depository
(London, Regno Unito)
Valutazione libreria
[?]

Descrizione libro Pearson Education (US), United States, 2005. Paperback. Condizione libro: New. 2005.. Language: English . Brand New Book. 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 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. 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. Codice libro della libreria AAU9780321227256

Maggiori informazioni su questa libreria | Fare una domanda alla libreria

Compra nuovo
EUR 32,95
Convertire valuta

Aggiungere al carrello

Spese di spedizione: GRATIS
Da: Regno Unito a: U.S.A.
Destinazione, tempi e costi

2.

David Abrahams, Aleksey Gurtovoy
Editore: Pearson Education 2004-12-10, Boston, Mass. (2004)
ISBN 10: 0321227255 ISBN 13: 9780321227256
Nuovi Quantità: 1
Da
Blackwell's
(Oxford, OX, Regno Unito)
Valutazione libreria
[?]

Descrizione libro Pearson Education 2004-12-10, Boston, Mass., 2004. multimedia item. Condizione libro: New. Codice libro della libreria 9780321227256

Maggiori informazioni su questa libreria | Fare una domanda alla libreria

Compra nuovo
EUR 31,47
Convertire valuta

Aggiungere al carrello

Spese di spedizione: EUR 3,36
Da: Regno Unito a: U.S.A.
Destinazione, tempi e costi

3.

David Abrahams, Aleksey Gurtovoy
Editore: Pearson Education (US), United States (2005)
ISBN 10: 0321227255 ISBN 13: 9780321227256
Nuovi Paperback Quantità: 1
Da
The Book Depository US
(London, Regno Unito)
Valutazione libreria
[?]

Descrizione libro Pearson Education (US), United States, 2005. Paperback. Condizione libro: New. 2005.. Language: English . Brand New Book. 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 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. 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. Codice libro della libreria AAU9780321227256

Maggiori informazioni su questa libreria | Fare una domanda alla libreria

Compra nuovo
EUR 35,77
Convertire valuta

Aggiungere al carrello

Spese di spedizione: GRATIS
Da: Regno Unito a: U.S.A.
Destinazione, tempi e costi

4.

Abrahams, David; Gurtovoy, Aleksey
Editore: Pearson Education (US) (2004)
ISBN 10: 0321227255 ISBN 13: 9780321227256
Nuovi Brossura Quantità: 1
Valutazione libreria
[?]

Descrizione libro Pearson Education (US), 2004. Condizione libro: New. "C++ Template Metaprogramming" is a book on template metaprogramming with readable prose and practical examples. Num Pages: 400 pages, Illustrations. BIC Classification: UMX. Category: (U) Tertiary Education (US: College). Dimension: 235 x 188 x 24. Weight in Grams: 702. . 2004. Paperback. . . . . . Codice libro della libreria V9780321227256

Maggiori informazioni su questa libreria | Fare una domanda alla libreria

Compra nuovo
EUR 37,06
Convertire valuta

Aggiungere al carrello

Spese di spedizione: GRATIS
Da: Irlanda a: U.S.A.
Destinazione, tempi e costi

5.

Abrahams, David; Gurtovoy, Aleksey
Editore: Pearson Education (US)
ISBN 10: 0321227255 ISBN 13: 9780321227256
Nuovi Brossura Quantità: 1
Da
Kennys Bookstore
(Olney, MD, U.S.A.)
Valutazione libreria
[?]

Descrizione libro Pearson Education (US). Condizione libro: New. "C++ Template Metaprogramming" is a book on template metaprogramming with readable prose and practical examples. Num Pages: 400 pages, Illustrations. BIC Classification: UMX. Category: (U) Tertiary Education (US: College). Dimension: 235 x 188 x 24. Weight in Grams: 702. . 2004. Paperback. . . . . Books ship from the US and Ireland. Codice libro della libreria V9780321227256

Maggiori informazioni su questa libreria | Fare una domanda alla libreria

Compra nuovo
EUR 38,90
Convertire valuta

Aggiungere al carrello

Spese di spedizione: GRATIS
In U.S.A.
Destinazione, tempi e costi

6.

David Abrahams; Aleksey Gurtovoy
ISBN 10: 0321227255 ISBN 13: 9780321227256
Nuovi Quantità: 1
Da
BWB
(Valley Stream, NY, U.S.A.)
Valutazione libreria
[?]

Descrizione libro Condizione libro: New. Depending on your location, this item may ship from the US or UK. Codice libro della libreria 97803212272560000000

Maggiori informazioni su questa libreria | Fare una domanda alla libreria

Compra nuovo
EUR 41,59
Convertire valuta

Aggiungere al carrello

Spese di spedizione: GRATIS
In U.S.A.
Destinazione, tempi e costi

7.

David Abrahams; Aleksey Gurtovoy
Editore: Addison Wesley (2004)
ISBN 10: 0321227255 ISBN 13: 9780321227256
Nuovi Brossura Quantità: 1
Da
Ria Christie Collections
(Uxbridge, Regno Unito)
Valutazione libreria
[?]

Descrizione libro Addison Wesley, 2004. Condizione libro: New. book. Codice libro della libreria ria9780321227256_rkm

Maggiori informazioni su questa libreria | Fare una domanda alla libreria

Compra nuovo
EUR 39,40
Convertire valuta

Aggiungere al carrello

Spese di spedizione: EUR 4,33
Da: Regno Unito a: U.S.A.
Destinazione, tempi e costi

8.

Abrahams, DavidGurtovoy, Aleksey
Editore: Prentice Hall
ISBN 10: 0321227255 ISBN 13: 9780321227256
Nuovi Quantità: > 20
Da
INDOO
(Avenel, NJ, U.S.A.)
Valutazione libreria
[?]

Descrizione libro Prentice Hall. Condizione libro: New. Brand New. Codice libro della libreria 0321227255

Maggiori informazioni su questa libreria | Fare una domanda alla libreria

Compra nuovo
EUR 40,76
Convertire valuta

Aggiungere al carrello

Spese di spedizione: EUR 3,01
In U.S.A.
Destinazione, tempi e costi

9.

Abrahams, David
Editore: Addison-Wesley Professional
ISBN 10: 0321227255 ISBN 13: 9780321227256
Nuovi Quantità: 1
Da
Ohmsoft LLC
(Lake Forest, IL, U.S.A.)
Valutazione libreria
[?]

Descrizione libro Addison-Wesley Professional. Condizione libro: Brand New. Ships from USA. FREE domestic shipping. Codice libro della libreria 0321227255

Maggiori informazioni su questa libreria | Fare una domanda alla libreria

Compra nuovo
EUR 49,87
Convertire valuta

Aggiungere al carrello

Spese di spedizione: GRATIS
In U.S.A.
Destinazione, tempi e costi

10.

Abrahams, David
ISBN 10: 0321227255 ISBN 13: 9780321227256
Nuovi Quantità: 1
Da
Pbshop
(Wood Dale, IL, U.S.A.)
Valutazione libreria
[?]

Descrizione libro 2004. PAP. Condizione libro: New. New Book.Shipped from US within 10 to 14 business days. Established seller since 2000. Codice libro della libreria IB-9780321227256

Maggiori informazioni su questa libreria | Fare una domanda alla libreria

Compra nuovo
EUR 46,75
Convertire valuta

Aggiungere al carrello

Spese di spedizione: EUR 3,43
In U.S.A.
Destinazione, tempi e costi

Vedi altre copie di questo libro

Vedi tutti i risultati per questo libro