posts - 58,  comments - 75,  trackbacks - 0

        这是我在看boost MPL时试着翻译的东西,现在贴上来。

A metafunction is a class or a class template that represents a function invocable at compile-time.
一个原操作是在编译器表现了调用操作的一个类或一个模板类。

An non-nullary metafunction is invoked by instantiating the class template with particular template parameters (metafunction arguments);
一个非无参的原操作被一个有详细模板参数的模板类请求;
the result of the metafunction application is accessible through the instantiation's nested type typedef.
原操作应用的返回值是一个通过模板类实例可取的内嵌的类型定义。

All metafunction's arguments must be types (i.e. only type template parameters are allowed).
所有的原操作的参数必须是类型。

A metafunction can have a variable number of parameters.
一个原操作能有一个数量变化的参数

A nullary metafunction is represented as a (template) class with a nested type typename member.
一个无参数原操作被表现为有内嵌重命名类型的类

原操作的三种表达式(f是一个原操作)
1 f::type
2 f<>::type
3 f< a1,..,an >::type


Lambda Expression 构造和分配表达式

A Lambda Expression is a compile-time invocable entity in either of the following two forms:
一个构造和分配表达式是下面两个中的一个编译期调用单元

Metafunction Class
原操作类

Placeholder Expression
站位符表达式

Most of the MPL components accept either of those, and the concept gives us a consice way to describe these requirements.
大部分的MPL组件接收它们其中一个,

posted on 2007-04-07 16:20 walkspeed 阅读(483) 评论(0)  编辑 收藏 引用 所属分类: STL、Boost、范型编程C++语言

只有注册用户登录后才能发表评论。
网站导航: 博客园   IT新闻   BlogJava   知识库   博问   管理



<2007年4月>
25262728293031
1234567
891011121314
15161718192021
22232425262728
293012345

常用链接

留言簿(4)

随笔分类(64)

随笔档案(58)

文章分类(3)

文章档案(3)

相册

收藏夹(9)

C++零碎

好友

搜索

  •  

积分与排名

  • 积分 - 157884
  • 排名 - 163

最新评论

阅读排行榜

评论排行榜