中国开发网: 论坛: 超级垃圾站: 贴子 697864
龙之吻
这个程序不懂,希望大牛给解释下,谢谢
#include <iostream>
using namespace std;

template<int T>
struct factorial {
enum { value = T * factorial<T - 1>::value };
};

template<>
struct factorial<0> {
enum { value = 1 };
};

int main()
{
cout << factorial<6>::value << endl;
return 0;
}


机器人,这首歌学会了没有?

我们的目标是->没有蛀牙!

相关信息:


欢迎光临本社区,您还没有登录,不能发贴子。请在 这里登录