variadic25.c

来自「用于进行gcc测试」· C语言 代码 · 共 17 行

C
17
字号
// { dg-options "-std=gnu++0x" }template<int... Values>struct sum;template<>struct sum<> {  static const int value = 0;};template<int Value, int... Values>struct sum<Value, Values...> {  static const int value = Value + sum<Values...>::value;};int a0[sum<>::value == 0? 1 : -1];int a1[sum<1, 2, 3, 4, 5>::value == 15? 1 : -1];

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?