现在的位置: 首页 > 综合 > 正文

翻译The Boost C++ Metaprogramming Library--摘要和目录

2012年08月31日 ⁄ 综合 ⁄ 共 1478字 ⁄ 字号 评论关闭

The Boost C++ Metaprogramming Library

Aleksey Gurtovoyi and David Abrahamsii

iMetaCommunications, agurtovoy@meta-comm.com

iiBoost Consulting, david.abrahams@rcn.com

摘要

本文论述了Boost C++模板原编程库MPL),这是一个可扩充的编译时刻框架,它包括算法,序列和原函数类。这个库集合了从泛型编程(generic)和函数式编程(functional programming)领域抽象出来的一些重要的东西,并构建了一个功能强大而且易于使用的工具箱,它使得原编程对于日常编程环境(real-word enviroments)变得足够实用。MPL在很大程度上受到它的运行时刻对等库——标准模板库(STL)的影响,标准模板库是C++标准库的一部分[STL94], [ISO98].。和STL类似,MPL库定义了一个在概念上和实现上开放的框架作为将来不断完善的基础。这个库的基本概念和习惯用法使用户可以专注在问题的解决方案上,而不必在尚未确定是否需要使用MPL的情况下,查找针对某个特定的原编程问题所有可能的解决方法。这个库还提供了一个编译时刻处理Lambda表达式的工具用来对类模板随心所欲的进行修整currying? )和组合(composition),这个功能在STL里并没有与之相应的运行时刻版本。本文用一些例子和实际的程序讲解了MPL库的动机,用法,设计和实现;并且提供了一些关于C++模板原编程的经验。


关键字
:模板原编程(template metaprogramming), 泛型编程(generic programming),编程语言C++, 类型系统,多态,编译时刻


目录

1. 介绍

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. 基本用法

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 example revisited

2.3.5. iter_fold as the main iteration algorithm

2.3.6. Sequences of numbers

2.3.7. A variety of sequences

2.3.8. Loop/recursion unrolling

3. Lambda工具

4. 代码生成工具

5. 例子:编译时刻的FSM(有限状态机)生成器

5.1. Implementation

5.2. Related work

6. 致谢

参考文献

 

抱歉!评论已关闭.