1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
#include <iostream> template <int N> struct hoge { hoge<N + 1> next; }; template <> struct hoge<3> { static int const N = 3; hoge<N + 1> next; }; template <> struct hoge<10> { }; int main(void) { return 0; }
1 2
Line 6: error: template instantiation depth exceeds maximum of 128 (use -ftemplate-depth-NN to increase the maximum) instantiating 'struct hoge<132>' compilation terminated due to -Wfatal-errors.