`
阿尔萨斯
  • 浏览: 4170542 次
社区版块
存档分类
最新评论

Template Metaprogramming

 
阅读更多
<iframe align="center" marginwidth="0" marginheight="0" src="http://www.zealware.com/csdnblog.html" frameborder="0" width="728" scrolling="no" height="90"></iframe>
1. 何谓 Metaprogramming?
  • Metaprogram: program that manipulates another program.
  • Metaprogramming is not a new concept:
    • Compiler is a metaprogram: manipulates your code and produces code in a lower level code
    • Preprocessor
    • YACC
这个容易理解,就像 Metadata 是“关于数据的数据”一样,Meta 这个前缀本身是很能说明问题的,如果把编译器也看成是一个 Metaprogram ,那么这个概念的确是没有什么神秘的,计算机里面的绝大多数程序,干的事情都不外乎把这种数据变成另外一种数据。

2. Metaprogramming 的几种途径
  • One approach: external to the language that is being manipulated
  • Another approach: Domain language and host language are the same
第一种就是说的 YACC之类的了,当然,命令解释器也当仁不让的可以算是。
第二种么,Preprocessor 当然算是了,template 则是重头戏了。

3. 举几个简单的例子先?
CppTM 领域最经典最简单的例子莫过于计算阶乘了,它简单而有用,同时体现了 CppTM 的递归本质。我想绝大多数人当年学习递归的时候也是从这个例子开始的:

#include <iostream></iostream>

using namespace std;

template <int n></int>
struct factorial
{
static const int value = N * factorial<n>::value;</n>
};

template
struct factorial
{
static const int value = 1;
};

int main()
{
cout : " ::value
cout ::value]: "
sizeof(char[factorial::value]) / sizeof(char)
}

输出:

factorial: 3628800
sizeof char[factorial::value]: 24

这只是一个回顾,上面的简单程序就不用我解释了吧?下面的这个 remove_cv 算法会去掉参数类型的 const 和 volatile 修饰符(如果有的话),Boost type_traits 就是这么干的。

#include <iostream></iostream>

using namespace std;

template <class t> struct remove_cv </class>
{ typedef T type; };

template <class t> struct remove_cv<const volatile t></const></class>
{ typedef T type; };

template <class t> struct remove_cv<const t></const></class>
{ typedef T type; };

template <class t> struct remove_cv<volatile t></volatile></class>
{ typedef T type; };

int main()
{
cout : "
::type).name()
cout : "
::type).name()
cout : "
::type).name()
}

输出:

remove_cv<const int>: int</const>
remove_cv<volatile int>: int</volatile>
remove_cv<const volatile int>: int</const>

这个也很简单,但是非常有用。最后再来一个,相当有用的,它让我们可以在编译期间把一个数字作为二进制数来解释:

#include <iostream></iostream>

using namespace std;

template <unsigned long n></unsigned>
struct binary
{
static unsigned const value =
binary<n>::value <br style="color: rgb(51, 51, 153);"><span style="color: rgb(51, 51, 153);">};</span><br style="color: rgb(51, 51, 153);"><br style="color: rgb(51, 51, 153);"><span style="color: rgb(51, 51, 153);">template </span><br style="color: rgb(51, 51, 153);"><span style="color: rgb(51, 51, 153);">struct binary </span><br style="color: rgb(51, 51, 153);"><span style="color: rgb(51, 51, 153);">{ </span><br style="color: rgb(51, 51, 153);"><span style="color: rgb(51, 51, 153);"> static unsigned const value = 0;</span><br style="color: rgb(51, 51, 153);"><span style="color: rgb(51, 51, 153);">};</span><br style="color: rgb(51, 51, 153);"><br style="color: rgb(51, 51, 153);"><span style="color: rgb(51, 51, 153);">int main()</span><br style="color: rgb(51, 51, 153);"><span style="color: rgb(51, 51, 153);">{</span><br style="color: rgb(51, 51, 153);"><span style="color: rgb(51, 51, 153);"> cout : " ::value <br style="color: rgb(51, 51, 153);"><span style="color: rgb(51, 51, 153);"> cout : " ::value <br style="color: rgb(51, 51, 153);"><span style="color: rgb(51, 51, 153);"> cout : " ::value <br style="color: rgb(51, 51, 153);"><span style="color: rgb(51, 51, 153);"> cout : " ::value <br style="color: rgb(51, 51, 153);"><span style="color: rgb(51, 51, 153);"> cout : " ::value <br style="color: rgb(51, 51, 153);"><span style="color: rgb(51, 51, 153);">}</span><br><br>输出:<br><br><span style="color: rgb(128, 128, 128);">binary: 1</span><br style="color: rgb(128, 128, 128);"><span style="color: rgb(128, 128, 128);">binary: 3</span><br style="color: rgb(128, 128, 128);"><span style="color: rgb(128, 128, 128);">binary: 5</span><br style="color: rgb(128, 128, 128);"><span style="color: rgb(128, 128, 128);">binary: 7</span><br style="color: rgb(128, 128, 128);"><span style="color: rgb(128, 128, 128);">binary: 93</span><br><br>不过上面这个程序不容错,换句话说,如果你写 binary::value ,编译器不会阻止你,还会给出一个愚蠢的答案。如果要做一个容错的解释器,只需要玩一个小小的把戏(本人原创):<br><br><span style="color: rgb(51, 51, 153);">#include <iostream></iostream></span><br style="color: rgb(51, 51, 153);"><br style="color: rgb(51, 51, 153);"><span style="color: rgb(51, 51, 153);">using namespace std;</span><br style="color: rgb(51, 51, 153);"><br style="color: rgb(51, 51, 153);"><span style="color: rgb(51, 51, 153);">namespace aux{</span><br style="color: rgb(51, 51, 153);"><span style="color: rgb(51, 51, 153);"> // 对于 0 和 1 以外的数,都不定义 value ,这样在出现 0 1 之外的数</span><br style="color: rgb(51, 51, 153);"><span style="color: rgb(51, 51, 153);"> // 的时候,编译器会抱怨找不到 value </span><br style="color: rgb(51, 51, 153);"><span style="color: rgb(51, 51, 153);"> template <unsigned long n></unsigned></span><br style="color: rgb(51, 51, 153);"><span style="color: rgb(51, 51, 153);"> struct binary</span><br style="color: rgb(51, 51, 153);"><span style="color: rgb(51, 51, 153);"> {};</span><br style="color: rgb(51, 51, 153);"><span style="color: rgb(51, 51, 153);"> </span><br style="color: rgb(51, 51, 153);"><span style="color: rgb(51, 51, 153);"> template </span><br style="color: rgb(51, 51, 153);"><span style="color: rgb(51, 51, 153);"> struct binary</span><br style="color: rgb(51, 51, 153);"><span style="color: rgb(51, 51, 153);"> { static unsigned const value = 1; };</span><br style="color: rgb(51, 51, 153);"><span style="color: rgb(51, 51, 153);"> </span><br style="color: rgb(51, 51, 153);"><span style="color: rgb(51, 51, 153);"> template </span><br style="color: rgb(51, 51, 153);"><span style="color: rgb(51, 51, 153);"> struct binary</span><br style="color: rgb(51, 51, 153);"><span style="color: rgb(51, 51, 153);"> { static unsigned const value = 0; };</span><br style="color: rgb(51, 51, 153);"><span style="color: rgb(51, 51, 153);">}</span><br style="color: rgb(51, 51, 153);"><br style="color: rgb(51, 51, 153);"><span style="color: rgb(51, 51, 153);">template <unsigned long n></unsigned></span><br style="color: rgb(51, 51, 153);"><span style="color: rgb(51, 51, 153);">struct binary</span><br style="color: rgb(51, 51, 153);"><span style="color: rgb(51, 51, 153);">{ </span><br style="color: rgb(51, 51, 153);"><span style="color: rgb(51, 51, 153);"> static unsigned const value = </span><br style="color: rgb(51, 51, 153);"><span style="color: rgb(51, 51, 153);"> binary<n>::value ::value;</n></span><br style="color: rgb(51, 51, 153);"><span style="color: rgb(51, 51, 153);">};</span><br style="color: rgb(51, 51, 153);"><br style="color: rgb(51, 51, 153);"><br style="color: rgb(51, 51, 153);"><span style="color: rgb(51, 51, 153);">template </span><br style="color: rgb(51, 51, 153);"><span style="color: rgb(51, 51, 153);">struct binary </span><br style="color: rgb(51, 51, 153);"><span style="color: rgb(51, 51, 153);">{ </span><br style="color: rgb(51, 51, 153);"><span style="color: rgb(51, 51, 153);"> static unsigned const value = 0;</span><br style="color: rgb(51, 51, 153);"><span style="color: rgb(51, 51, 153);">};</span><br style="color: rgb(51, 51, 153);"><br style="color: rgb(51, 51, 153);"><span style="color: rgb(51, 51, 153);">int main()</span><br style="color: rgb(51, 51, 153);"><span style="color: rgb(51, 51, 153);">{</span><br style="color: rgb(51, 51, 153);"><span style="color: rgb(51, 51, 153);"> cout : " ::value <br style="color: rgb(51, 51, 153);"><span style="color: rgb(51, 51, 153);"> cout : " ::value <br style="color: rgb(51, 51, 153);"><span style="color: rgb(51, 51, 153);"> cout : " ::value <br style="color: rgb(51, 51, 153);"><span style="color: rgb(51, 51, 153);"> cout : " ::value <br style="color: rgb(51, 51, 153);"><span style="color: rgb(51, 51, 153);"> cout : " ::value <br style="color: rgb(51, 51, 153);"><span style="color: rgb(51, 51, 153);"> // 你可以 uncomment 下面这一行看看会发生什么 </span><br style="color: rgb(51, 51, 153);"><span style="color: rgb(51, 51, 153);"> //cout : " ::value <br style="color: rgb(51, 51, 153);"><span style="color: rgb(51, 51, 153);">}</span><br><br>输出还是一样,但是如果你写了 binary::value 这样的东西,编译器就会抱怨了:<br><br><span style="color: rgb(128, 128, 128);">error C2039: 'value' : is not a member of 'aux::binary<n>'</n></span><br style="color: rgb(128, 128, 128);"><span style="color: rgb(128, 128, 128);"> with</span><br style="color: rgb(128, 128, 128);"><span style="color: rgb(128, 128, 128);"> [</span><br style="color: rgb(128, 128, 128);"><span style="color: rgb(128, 128, 128);"> N=2</span><br style="color: rgb(128, 128, 128);"><span style="color: rgb(128, 128, 128);"> ]</span><br style="color: rgb(128, 128, 128);"><span style="color: rgb(128, 128, 128);">// bla bla bla</span><br><br>好了,例子够多了,我们可以稍微总结一下。CppTM 的好处在于:<br><ol> <li>把很多计算放到编译期间完成,使得运行效率大为提高</li> <li>由于计算在编译期间完成,很多错误也可以在编译期间发现,程序员不用到了程序开始跑了才进入痛苦的调试</li> <li>有一些事情,比如 remove_cv ,在运行期间还的确不那么好做</li> </ol> <br>4. 我怎么开始 Metaprogamming 呢?<br>在我们开始学习编程的时候,首先学到的是赋值、条件判断、循环等等。在 CppTM 中,这些有了变化,如下:<br><br>循环 --&gt; 模板递归<br>条件判断 --&gt; 模板偏特化<br>赋值 --&gt; 没有,变量的值一旦确定就不会变化(这对于 functional programming 是常事)<br>函数输入输出 --&gt; 类型和常量<br><br>其实这些特征并不是什么旁门左道,正好相反,它具有 functional programming 的特征,符合图灵机模型(感兴趣的话可以看这篇 paper: <a href="http://osl.iu.edu/~tveldhui/papers/2003/turing.pdf">C++ Templates are Turing Complete</a>)。<br><br>5. 模板偏特化是个好东西,但是我每次都要把 if...then...else 映射成它,岂不是要累死?况且这编码量也太大...<br>这是个好问题,好在在计算机科学里面有一句箴言:You can solve everything by adding an extra layer of abstraction. 使用模板偏特化进行条件判断如此常用,我们完全应该把它抽象出来以备重用:<br><br><span style="color: rgb(51, 51, 153);">template <bool cond class then else></bool></span><br style="color: rgb(51, 51, 153);"><span style="color: rgb(51, 51, 153);">struct if_ </span><br style="color: rgb(51, 51, 153);"><span style="color: rgb(51, 51, 153);">{ typedef Then type; };</span><br style="color: rgb(51, 51, 153);"><br style="color: rgb(51, 51, 153);"><span style="color: rgb(51, 51, 153);">template <class then class else></class></span><br style="color: rgb(51, 51, 153);"><span style="color: rgb(51, 51, 153);">struct if_ <false then else></false></span><br style="color: rgb(51, 51, 153);"><span style="color: rgb(51, 51, 153);">{ typedef Else type; };</span><br><br>简单吧? 虽然简单,但是我们从此却可以在更高的抽象层面上看问题,我们摆脱了用模板偏特化思考,现在可以直接用 if...then...else 来思考了。那么,上面解释二进制数的程序就变成了下面这样:<br><br><span style="color: rgb(51, 51, 153);">#include <iostream></iostream></span><br style="color: rgb(51, 51, 153);"><br style="color: rgb(51, 51, 153);"><span style="color: rgb(51, 51, 153);">using namespace std;</span><br style="color: rgb(51, 51, 153);"><br style="color: rgb(51, 51, 153);"><span style="color: rgb(51, 51, 153);">template <bool cond class then else></bool></span><br style="color: rgb(51, 51, 153);"><span style="color: rgb(51, 51, 153);">struct if_ </span><br style="color: rgb(51, 51, 153);"><span style="color: rgb(51, 51, 153);">{ typedef Then type; };</span><br style="color: rgb(51, 51, 153);"><br style="color: rgb(51, 51, 153);"><span style="color: rgb(51, 51, 153);">template <class then class else></class></span><br style="color: rgb(51, 51, 153);"><span style="color: rgb(51, 51, 153);">struct if_ <false then else></false></span><br style="color: rgb(51, 51, 153);"><span style="color: rgb(51, 51, 153);">{ typedef Else type; };</span><br style="color: rgb(51, 51, 153);"><br style="color: rgb(51, 51, 153);"><br style="color: rgb(51, 51, 153);"><span style="color: rgb(51, 51, 153);">namespace aux{</span><br style="color: rgb(51, 51, 153);"><span style="color: rgb(51, 51, 153);"> struct one</span><br style="color: rgb(51, 51, 153);"><span style="color: rgb(51, 51, 153);"> { static unsigned const value = 1; };</span><br style="color: rgb(51, 51, 153);"><span style="color: rgb(51, 51, 153);"> struct zero</span><br style="color: rgb(51, 51, 153);"><span style="color: rgb(51, 51, 153);"> { static unsigned const value = 0; };</span><br style="color: rgb(51, 51, 153);"><span style="color: rgb(51, 51, 153);"> struct other</span><br style="color: rgb(51, 51, 153);"><span style="color: rgb(51, 51, 153);"> {};</span><br style="color: rgb(51, 51, 153);"><span style="color: rgb(51, 51, 153);">}</span><br style="color: rgb(51, 51, 153);"><br style="color: rgb(51, 51, 153);"><span style="color: rgb(51, 51, 153);">template <unsigned long n></unsigned></span><br style="color: rgb(51, 51, 153);"><span style="color: rgb(51, 51, 153);">struct binary</span><br style="color: rgb(51, 51, 153);"><span style="color: rgb(51, 51, 153);">{ </span><br style="color: rgb(51, 51, 153);"><span style="color: rgb(51, 51, 153);"> static unsigned const value = </span><br style="color: rgb(51, 51, 153);"><span style="color: rgb(51, 51, 153);"> if_ <n aux::zero binary> &gt;::type::value <br style="color: rgb(51, 51, 153);"><span style="color: rgb(51, 51, 153);"> if_ <n aux::zero><br style="color: rgb(51, 51, 153);"><span style="color: rgb(51, 51, 153);"> if_ <n aux::one aux::other>::type</n></span><br style="color: rgb(51, 51, 153);"><span style="color: rgb(51, 51, 153);"> &gt;::type::value;</span><br style="color: rgb(51, 51, 153);"><span style="color: rgb(51, 51, 153);">};</span><br style="color: rgb(51, 51, 153);"><br style="color: rgb(51, 51, 153);"><span style="color: rgb(51, 51, 153);">int main()</span><br style="color: rgb(51, 51, 153);"><span style="color: rgb(51, 51, 153);">{</span><br style="color: rgb(51, 51, 153);"><span style="color: rgb(51, 51, 153);"> cout : " ::value <br style="color: rgb(51, 51, 153);"><span style="color: rgb(51, 51, 153);"> cout : " ::value <br style="color: rgb(51, 51, 153);"><span style="color: rgb(51, 51, 153);"> cout : " ::value <br style="color: rgb(51, 51, 153);"><span style="color: rgb(51, 51, 153);"> cout : " ::value <br style="color: rgb(51, 51, 153);"><span style="color: rgb(51, 51, 153);"> cout : " ::value <br style="color: rgb(51, 51, 153);"><span style="color: rgb(51, 51, 153);"> // 你可以 uncomment 下面这一行看看会发生什么 </span><br style="color: rgb(51, 51, 153);"><span style="color: rgb(51, 51, 153);"> //cout : " ::value <br style="color: rgb(51, 51, 153);"><span style="color: rgb(51, 51, 153);">}</span><br><br>输出还是一样,但是现在不仅程序长度减少,而且相关的逻辑也用我们熟悉的 if...then...else 的方式来表达。多一层抽象果然威力强大!当然,循环还是要用模板递归的。<br><br>6. 流程控制的问题解决了,下面呢?我们是不是需要一些容器,像 STL 那样?<br>如果要表达一个装“类型”的容器,你会怎么做?象下面这样么?<br><br><span style="color: rgb(51, 51, 153);">struct types </span><br style="color: rgb(51, 51, 153);"><span style="color: rgb(51, 51, 153);">{ </span><br style="color: rgb(51, 51, 153);"><span style="color: rgb(51, 51, 153);"> typedef int t1;</span><br style="color: rgb(51, 51, 153);"><span style="color: rgb(51, 51, 153);"> typdef long t2;</span><br style="color: rgb(51, 51, 153);"><span style="color: rgb(51, 51, 153);"> typedef std::vector<double> t3;</double></span><br style="color: rgb(51, 51, 153);"><span style="color: rgb(51, 51, 153);">}</span><br style="color: rgb(51, 51, 153);"><br style="color: rgb(51, 51, 153);">大概只要稍微明智一点,你就会马上放弃这个想法,它太没有通用性了。真正的启示来自于 Lisp ,在 Lisp 中,表是最重要的数据结构,几乎是“万物皆表”。一个表由一个头和一个尾组成,可以嵌套,空表用 nil 表示。这种简单的概念却有着不可思议的表达能力。如果我们用 C++ 来模拟,就是这样:<br><br><span style="color: rgb(51, 51, 153);">template <class first class rest></class></span><br style="color: rgb(51, 51, 153);"><span style="color: rgb(51, 51, 153);">struct cons </span><br style="color: rgb(51, 51, 153);"><span style="color: rgb(51, 51, 153);">{ </span><br style="color: rgb(51, 51, 153);"><span style="color: rgb(51, 51, 153);"> typedef First first;</span><br style="color: rgb(51, 51, 153);"><span style="color: rgb(51, 51, 153);"> typedef Rest rest;</span><br style="color: rgb(51, 51, 153);"><span style="color: rgb(51, 51, 153);">};</span><br style="color: rgb(51, 51, 153);"><br style="color: rgb(51, 51, 153);"><span style="color: rgb(51, 51, 153);">struct nil {};</span><br><br>现在我们需要表示一个类型列表就有章可循了:<br><br><span style="color: rgb(51, 51, 153);">typedef</span><br style="color: rgb(51, 51, 153);"><span style="color: rgb(51, 51, 153);"> cons<int><br style="color: rgb(51, 51, 153);"><span style="color: rgb(51, 51, 153);"> cons<long><br style="color: rgb(51, 51, 153);"><span style="color: rgb(51, 51, 153);"> cons<:vector>,</:vector></span><br style="color: rgb(51, 51, 153);"><span style="color: rgb(51, 51, 153);"> nil&gt; &gt; &gt; a_type_list;</span><br><br>它是递归的,从而我们可以很容易的用递归的方式来对它们作协操作,用来操作它们的,就是 Metafunction,前面的 if_ 就是一个 Metafunction。例如我们想选择两个类型中比较大的一个,可以写一个 choose_larger Metafunction:<br><br><span style="color: rgb(51, 51, 153);">template <typename t1 typename t2></typename></span><br style="color: rgb(51, 51, 153);"><span style="color: rgb(51, 51, 153);">struct choose_larger</span><br style="color: rgb(51, 51, 153);"><span style="color: rgb(51, 51, 153);">{</span><br style="color: rgb(51, 51, 153);"><span style="color: rgb(51, 51, 153);"> typedef typename if_ sizeof(T2)), T1, T2&gt;::type type;</span><br style="color: rgb(51, 51, 153);"><span style="color: rgb(51, 51, 153);">};</span><br><br>我们再次看到,由于有了 if_ ,我们的生活变得轻松多了。让我们继续向前发展,我们不想仅仅停留在两个类型比大小上,我们希望选择一个 type list 里面最大的那一个:<br><br><span style="color: rgb(51, 51, 153);">template <typename t> struct largest;</typename></span><br style="color: rgb(51, 51, 153);"><br style="color: rgb(51, 51, 153);"><span style="color: rgb(51, 51, 153);">template <typename first typename rest></typename></span><br style="color: rgb(51, 51, 153);"><span style="color: rgb(51, 51, 153);">struct largest<cons rest> &gt;</cons></span><br style="color: rgb(51, 51, 153);"><span style="color: rgb(51, 51, 153);"> : choose_larger<first typename largest>::type&gt;</first></span><br style="color: rgb(51, 51, 153);"><span style="color: rgb(51, 51, 153);">{};</span><br style="color: rgb(51, 51, 153);"><br style="color: rgb(51, 51, 153);"><span style="color: rgb(51, 51, 153);">template</span><br style="color: rgb(51, 51, 153);"><span style="color: rgb(51, 51, 153);">struct largest<cons> &gt; </cons></span><br style="color: rgb(51, 51, 153);"><span style="color: rgb(51, 51, 153);">{ typedef First type; };</span><br><br>其实上面的也可以用上 if_ ,只不过我们现在还没有写出判断一个类型是否为 nil 的 Metafunction ,这是件很简单的事情,大家可以自己去写写看。有了它们,得到一个 type list 里面最大的元素就轻而易举了:<br><br><span style="color: rgb(51, 51, 153);">#include <vector></vector></span><br style="color: rgb(51, 51, 153);"><span style="color: rgb(51, 51, 153);">#include <iostream></iostream></span><br style="color: rgb(51, 51, 153);"><br style="color: rgb(51, 51, 153);"><span style="color: rgb(51, 51, 153);">using namespace std;</span><br style="color: rgb(51, 51, 153);"><br style="color: rgb(51, 51, 153);"><span style="color: rgb(51, 51, 153);">//... 上面的那些 Metafunction </span><br style="color: rgb(51, 51, 153);"><br style="color: rgb(51, 51, 153);"><span style="color: rgb(51, 51, 153);">int main()</span><br style="color: rgb(51, 51, 153);"><span style="color: rgb(51, 51, 153);">{</span><br style="color: rgb(51, 51, 153);"><span style="color: rgb(51, 51, 153);"> typedef</span><br style="color: rgb(51, 51, 153);"><span style="color: rgb(51, 51, 153);"> cons<int><br style="color: rgb(51, 51, 153);"><span style="color: rgb(51, 51, 153);"> cons<long><br style="color: rgb(51, 51, 153);"><span style="color: rgb(51, 51, 153);"> cons<:vector>,</:vector></span><br style="color: rgb(51, 51, 153);"><span style="color: rgb(51, 51, 153);"> nil&gt; &gt; &gt; type_list;</span><br style="color: rgb(51, 51, 153);"><span style="color: rgb(51, 51, 153);"> </span><br style="color: rgb(51, 51, 153);"><span style="color: rgb(51, 51, 153);"> cout ::type).name() <br style="color: rgb(51, 51, 153);"><span style="color: rgb(51, 51, 153);">}</span><br><br>输出:<br><br style="color: rgb(128, 128, 128);"><span style="color: rgb(128, 128, 128);">class std::vector<double std::allocator> &gt;</double></span><br><br>7. 的确很棒,但是这跟我们当年学数据结构以后,没事就写个链表玩玩差不多,在生产环境中可不能这样,用什么通用的方法么?<br>终于到了这一步,在“重复发明轮子”足够多次以后,终于就有人会出来发明通用轮子的,MPL 就是一个很好的尝试,当然 Loki 也算是。<br>还记得 if_ 让我们尝到的甜头么?聪明人在看到了这些甜头以后,是决不会止步不前的,Dave Abrahams 和 Aleskey Gurtovoy 就是这样的聪明人,他们发明了 MPL 。留到下一篇好了。<br><br><br><br><br></span></long></span></int></span></long></span></int></span></span></span></span></span></span></span></n></span></n></span></span></span></span></span></span></span></span></span></span></span></span></n>
分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics