#include <functional>
#include <type_traits>
constexpr int ParametersCountLimit = 100;
template <typename Head, typename ... Tail>
struct helper
{
using guard = typename std::enable_if<sizeof...(Tail) < ParametersCountLimit>::type;
using next = helper<Head, Tail..., Head>;
using fn = Head(Head, Tail...);
};
template <typename T, int N>
struct generator
{
using helper_type = typename generator<T, N-1>::helper_type::next;
using type = typename helper_type::fn;
};
template <typename T>
struct generator<T,2>
{
using helper_type = helper<T, T>;
using type = typename helper_type::fn;
};
template <class T>
class TD;
int main()
{
TD< generator<int,99>::type > d;
return 0;
}
I2luY2x1ZGUgPGZ1bmN0aW9uYWw+CiNpbmNsdWRlIDx0eXBlX3RyYWl0cz4KCmNvbnN0ZXhwciBpbnQgUGFyYW1ldGVyc0NvdW50TGltaXQgPSAxMDA7Cgp0ZW1wbGF0ZSA8dHlwZW5hbWUgSGVhZCwgdHlwZW5hbWUgLi4uIFRhaWw+CnN0cnVjdCBoZWxwZXIKewoJdXNpbmcgZ3VhcmQgPSB0eXBlbmFtZSBzdGQ6OmVuYWJsZV9pZjxzaXplb2YuLi4oVGFpbCkgPCBQYXJhbWV0ZXJzQ291bnRMaW1pdD46OnR5cGU7Cgl1c2luZyBuZXh0ID0gaGVscGVyPEhlYWQsIFRhaWwuLi4sIEhlYWQ+OwoJdXNpbmcgZm4gPSBIZWFkKEhlYWQsIFRhaWwuLi4pOwp9OwoKdGVtcGxhdGUgPHR5cGVuYW1lIFQsIGludCBOPgpzdHJ1Y3QgZ2VuZXJhdG9yCnsKCXVzaW5nIGhlbHBlcl90eXBlID0gdHlwZW5hbWUgZ2VuZXJhdG9yPFQsIE4tMT46OmhlbHBlcl90eXBlOjpuZXh0OwoJdXNpbmcgdHlwZSA9IHR5cGVuYW1lIGhlbHBlcl90eXBlOjpmbjsKfTsKCnRlbXBsYXRlIDx0eXBlbmFtZSBUPgpzdHJ1Y3QgZ2VuZXJhdG9yPFQsMj4KewoJdXNpbmcgaGVscGVyX3R5cGUgPSBoZWxwZXI8VCwgVD47Cgl1c2luZyB0eXBlID0gdHlwZW5hbWUgaGVscGVyX3R5cGU6OmZuOwp9OwoKdGVtcGxhdGUgPGNsYXNzIFQ+CmNsYXNzIFREOwoKaW50IG1haW4oKQp7CglURDwgZ2VuZXJhdG9yPGludCw5OT46OnR5cGUgPiBkOwoJcmV0dXJuIDA7Cn0K
prog.cpp: In function 'int main()':
prog.cpp:33:32: error: aggregate 'TD<int(int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int)> d' has incomplete type and cannot be defined
TD< generator<int,99>::type > d;
^