I found implement of C++14 make_index_sequence \'algorithm\':
template< int ... > struct index_sequence{ using type = index_sequence; };
template&l
The compilation is slow and uses a lot of memory because you are recursively expanding templates. This is being done at compile time, it creates a large number of types, and this can use a lot of memory. It is not caused by sizeof or any other individual statement. It is the recursion that causes every bit of the template expansion to be expensive.
I've hit this exact same problem with VC++ -- I found that my compiles would get arbitrarily slow as I passed in larger constants to a template function that I wrote.
Of course, in my case I was trying to make the compiler run slowly. But still, maybe this will be helpful:
https://randomascii.wordpress.com/2014/03/10/making-compiles-slow/