by David Abrahams and Aleksey Gurtovoy
Publisher | Pearson Education |
Language | English |
Book type | Other |
Utgiven | 2004-12-22 |
Pages | 408 |
ISBN | 9780321227256 |
Kategori(er) |
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.
So far, we have reused
2
5
0
5
7
9
3
books.
Sweden's friendliest and environmental friendliest bookshop with the lowest priced textbooks.
This is our ambition, and we do what it takes to get there. We are here to help students to save and earn money on their textbooks while we at the same time save the environment. We were started in 2005 by two students and have since strived to constantly make it easier to buy and sell used textbooks for as many as possible.
Subscribe to receive our best student tips, offers and promotions.
Read more about how we handle personal data in our privacy policy.