The Boost C Metaprogramming Library
Aleksey Gurtovoyi and David Abrahamsii
Imetacommunications, Agurtovoy@meta-comm.com
Iiboost Consulting, David.abrahams@rcn.com
Summary
This article discusses the Boost C template original programming library (MPL), which is an expandable compilation time frame, which includes algorithms, sequences, and original functions. This library collects some important things abstract from the field of generic and functional programming, and build a powerful and easy-to-use toolbox, which makes the original programming environment for the daily programming environment ( Real-word enviroments becomes practical. MPL is largely affected by its runtime, standard template library (STL), standard template library is part of the C standard library [STL94], [ISO98] .. Similar to STL, the MPL library defines a framework that is conceptual and implemented as a continuous improvement of future. The basic concepts and habits of this library allow users to focus on a problem solution, without having to determine if you need to use MPL, find all possible solutions for a specific original programming issue. This library also provides a compilation time to handle the tool for lambda expressions to trim (currying?) And combination for class templates, this feature does not have corresponding runtime versions in STL. This article uses some examples and practical procedures to explain the motivation, usage, design, and implementation of the MPL library; and provide some experience in programming C template.
Keywords: template Metaprogramming, generic programming, programming language, C , type system, polymorphism, compilation
table of Contents
1 Introduction
1.1. Native language metaprogramming
1.2. Metaprogramming IN C
1.2.1. Numeric Computations
1.2.2. Type Computations
1.2.3. Type Sequences
1.3. Why metaprogramming?
1.4. Why a metaprogramming library?
2. Basic usage
2.1. Conditional Type SELECTION
2.1.1. Delayed Evaluation
2.2. MetaFunctions
2.2.1. THE Simple Form
2.2.2. Higher-Order MetaFunctions
2.2.3. MetaFunction Classes
2.2.4. ONE SIZE FITS ALL?
2.2.5. From metafunction to metafunction class
2.3. Sequences, Algorithms, and Iterators
2.3.1. Introduction
2.3.2. Algorithms and SEQUENCES
2.3.3. Sequence Concepts
2.3.4. Ad hoc escisited
2.3.5. It is..... Sequences of numbers
2.3.7. A Variety of Sequences
2.3.8. Loop / recuty unrolling
3. Lambda Tools
4. Code generation tool
5. Example: FSM (finite state machine) generator compiled
5.1. Implementation
5.2. Related Work
6. Acknowledgment
references