1. C++ Template Metaprogramming: Concepts, Tools, and Techniques from Boost and Beyond
2. Table of Contents
3. Copyright
4. The C++ In-Depth Series
4.1 Titles in the Series
5. Preface
6. Acknowledgments
6.1 Dave's Acknowledgments
6.2 Aleksey's Acknowledgments
7. Making the Most of This Book
7.1 Supplementary Material
7.2 Trying It Out
8. Chapter 1. Introduction
8.1 Section 1.1. Getting Started
8.2 Section 1.2. So What's a Metaprogram?
8.3 Section 1.3. Metaprogramming in the Host Language
8.4 Section 1.4. Metaprogramming in C++
8.5 Section 1.5. Why Metaprogramming?
8.6 Section 1.6. When Metaprogramming?
8.7 Section 1.7. Why a Metaprogramming Library?
9. Chapter 2. Traits and Type Manipulation
9.1 Section 2.1. Type Associations
9.2 Section 2.2. Metafunctions
9.3 Section 2.3. Numerical Metafunctions
9.4 Section 2.4. Making Choices at Compile Time
9.5 Section 2.5. A Brief Tour of the Boost Type Traits Library
9.6 Section 2.6. Nullary Metafunctions
9.7 Section 2.7. Metafunction Definition
9.8 Section 2.8. History
9.9 Section 2.9. Details
9.10 Section 2.10. Exercises
10. Chapter 3. A Deeper Look at Metafunctions
10.1 Section 3.1. Dimensional Analysis
10.2 Section 3.2. Higher-Order Metafunctions
10.3 Section 3.3. Handling Placeholders
10.4 Section 3.4. More Lambda Capabilities
10.5 Section 3.5. Lambda Details
10.6 Section 3.6. Details
10.7 Section 3.7. Exercises
11. Chapter 4. Integral Type Wrappers and Operations
11.1 Section 4.1. Boolean Wrappers and Operations
11.2 Section 4.2. Integer Wrappers and Operations
11.3 Section 4.3. Exercises
12. Chapter 5. Sequences and Iterators
12.1 Section 5.1. Concepts
12.2 Section 5.2. Sequences and Algorithms
12.3 Section 5.3. Iterators
12.4 Section 5.4. Iterator Concepts
12.5 Section 5.5. Sequence Concepts
12.6 Section 5.6. Sequence Equality
12.7 Section 5.7. Intrinsic Sequence Operations
12.8 Section 5.8. Sequence Classes
12.9 Section 5.9. Integral Sequence Wrappers
12.10 Section 5.10. Sequence Derivation
12.11 Section 5.11. Writing Your Own Sequence
12.12 Section 5.12. Details
12.13 Section 5.13. Exercises
13. Chapter 6. Algorithms
13.1 Section 6.1. Algorithms, Idioms, Reuse, and Abstraction
13.2 Section 6.2. Algorithms in the MPL
13.3 Section 6.3. Inserters
13.4 Section 6.4. Fundamental Sequence Algorithms
13.5 Section 6.5. Querying Algorithms
13.6 Section 6.6. Sequence Building Algorithms
13.7 Section 6.7. Writing Your Own Algorithms
13.8 Section 6.8. Details
13.9 Section 6.9. Exercises
14. Chapter 7. Views and Iterator Adaptors
14.1 Section 7.1. A Few Examples
14.2 Section 7.2. View Concept
14.3 Section 7.3. Iterator Adaptors
14.4 Section 7.4. Writing Your Own View
14.5 Section 7.5. History
14.6 Section 7.6. Exercises
15. Chapter 8. Diagnostics
15.1 Section 8.1. Debugging the Error Novel
15.2 Section 8.2. Using Tools for Diagnostic Analysis
15.3 Section 8.3. Intentional Diagnostic Generation
15.4 Section 8.4. History
15.5 Section 8.5. Details
15.6 Section 8.6. Exercises
16. Chapter 9. Crossing the Compile-Time/Runtime Boundary
16.1 Section 9.1. for_each
16.2 Section 9.2. Implementation Selection
16.3 Section 9.3. Object Generators
16.4 Section 9.4. Structure Selection
16.5 Section 9.5. Class Composition
16.6 Section 9.6. (Member) Function Pointers as Template Arguments
16.7 Section 9.7. Type Erasure
16.8 Section 9.8. The Curiously Recurring Template Pattern
16.9 Section 9.9. Explicitly Managing the Overload Set
16.10 Section 9.10. The "sizeof Trick"
16.11 Section 9.11. Summary
16.12 Section 9.12. Exercises
17. Chapter 10. Domain-Specific Embedded Languages
17.1 Section 10.1. A Little Language ...
17.2 Section 10.2. ... Goes a Long Way
17.3 Section 10.3. DSLs, Inside Out
17.4 Section 10.4. C++ as the Host Language
17.5 Section 10.5. Blitz++ and Expression Templates
17.6 Section 10.6. General-Purpose DSELs
17.7 Section 10.7. The Boost Spirit Library
17.8 Section 10.8. Summary
17.9 Section 10.9. Exercises
18. Chapter 11. A DSEL Design Walkthrough
18.1 Section 11.1. Finite State Machines
18.2 Section 11.2. Framework Design Goals
18.3 Section 11.3. Framework Interface Basics
18.4 Section 11.4. Choosing a DSL
18.5 Section 11.5. Implementation
18.6 Section 11.6. Analysis
18.7 Section 11.7. Language Directions
18.8 Section 11.8. Exercises
19. Appendix A. An Introduction to Preprocessor Metaprogramming
19.1 Section A.1. Motivation
19.2 Section A.2. Fundamental Abstractions of the Preprocessor
19.3 Section A.3. Preprocessor Library Structure
19.4 Section A.4. Preprocessor Library Abstractions
19.5 Section A.5. Exercise
20. Appendix B. The typename and template Keywords
20.1 Section B.1. The Issue
20.2 Section B.2. The Rules
21. Appendix C. Compile-Time Performance
21.1 Section C.1. The Computational Model
21.2 Section C.2. Managing Compilation Time
21.3 Section C.3. The Tests
22. Appendix D. MPL Portability Summary
23. CD-ROM Warranty
24. Bibliography