這是我在看boost MPL時(shí)試著翻譯的東西,現(xiàn)在貼上來(lái)。
A metafunction is a class or a class template that represents a function invocable at compile-time.
一個(gè)原操作是在編譯器表現(xiàn)了調(diào)用操作的一個(gè)類(lèi)或一個(gè)模板類(lèi)。
An non-nullary metafunction is invoked by instantiating the class template with particular template parameters (metafunction arguments);
一個(gè)非無(wú)參的原操作被一個(gè)有詳細(xì)模板參數(shù)的模板類(lèi)請(qǐng)求;
the result of the metafunction application is accessible through the instantiation's nested type typedef.
原操作應(yīng)用的返回值是一個(gè)通過(guò)模板類(lèi)實(shí)例可取的內(nèi)嵌的類(lèi)型定義。
All metafunction's arguments must be types (i.e. only type template parameters are allowed).
所有的原操作的參數(shù)必須是類(lèi)型。
A metafunction can have a variable number of parameters.
一個(gè)原操作能有一個(gè)數(shù)量變化的參數(shù)
A nullary metafunction is represented as a (template) class with a nested type typename member.
一個(gè)無(wú)參數(shù)原操作被表現(xiàn)為有內(nèi)嵌重命名類(lèi)型的類(lèi)
原操作的三種表達(dá)式(f是一個(gè)原操作)
1 f::type
2 f<>::type
3 f< a1,..,an >::type
Lambda Expression 構(gòu)造和分配表達(dá)式
A Lambda Expression is a compile-time invocable entity in either of the following two forms:
一個(gè)構(gòu)造和分配表達(dá)式是下面兩個(gè)中的一個(gè)編譯期調(diào)用單元
Metafunction Class
原操作類(lèi)
Placeholder Expression
站位符表達(dá)式
Most of the MPL components accept either of those, and the concept gives us a consice way to describe these requirements.
大部分的MPL組件接收它們其中一個(gè),
posted on 2007-04-07 16:20
walkspeed 閱讀(525)
評(píng)論(0) 編輯 收藏 引用 所屬分類(lèi):
STL、Boost、范型編程 、
C++語(yǔ)言