64,646
社区成员
发帖
与我相关
我的任务
分享
template<>
void assignValue<int>(int& val, const char* str)
{
..............//略
}
<int>
?是什么意思?
template <int V> // 通用版本
struct JS
{
enum {
VAL = V * JS<V-1>::VAL,
};
};
template<> // 对 1 进行特化
struct JS<1>
{
enum {
VAL = 1,
};
};
void main()
{
printf("%d", JS<4>::VAL);
}