[ create a new paste ] login | about

Link: http://codepad.org/2RHGKyqj    [ raw code | output | fork ]

C++, pasted on Apr 7:
#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;
}


Output:
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.


Create a new paste based on this one


Comments: