 Hi, I have been stuck on actually reversing the order of the sequences of exponents of 2 below for quite some time now. I hope someone is able to help. So, I should get an output from 1, 2, 4, 8.. etc. Not the reverse. Note: All of the meta() functions must be retained in the program below. Cannot remove!

 ``1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950`` ``````#include template struct int_seq{}; template struct sequence { using type = typename sequence< T- 1, 1, 2 * Ns... >::type; }; template struct sequence<0, Ns...> { using type = sequence; }; template using create_int_seq = typename sequence::type; template void print(T t) { std::cout << t << " "; } template void print(T t, Ts... ts) { print(ts...); std::cout << t << " "; } template < template class T, size_t... S > void print_type(T) { print(S...); } int main() { constexpr size_t N = 63; create_int_seq dum{}; print_type(dum); }``````
Last edited on Can I have an understanding of why my program results in this specific error
"Error C1202 recursive type or function dependency context too complex"
What does it mean? And how do I solve it?

 ``12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152`` `````` #include template class int_seq{}; template struct sequence { using type = typename sequence< T- 1, 2 * Ns... , 1 >::type; }; template struct sequence<0, Ns...> { using type = sequence; }; template using create_int_seq = typename sequence::type; template void print(T t) { std::cout << t << " "; } template void print(T t, Ts... ts) { print(ts...); std::cout << t << " "; } template < template class T, size_t... S > void print_type(T) { print(S...); } int main() { constexpr size_t N = 63; create_int_seq dum{}; print_type(dum); } ``````
Last edited on  Reaches limit of size_t:
18446744073709551615 = (2 * 9223372036854775808) - 1
https://en.cppreference.com/w/c/types/size_t

 ``123456789101112131415161718192021222324252627282930313233343536373839404142434445464748`` ``````#include template struct int_seq{}; // <---- template struct sequence { using type = typename sequence< T- 1, 1, 2 * Ns...>::type; // <---- }; template struct sequence<0, Ns...> { using type = sequence; }; template using create_int_seq = typename sequence::type; template void print(T t) { std::cout << t << " "; } template void print(T t, Ts... ts) { print(ts...); std::cout << t << " "; } template < template class T, size_t... S > void print_type(T) { print(S...); } int main() { constexpr size_t N = 128; // <--- create_int_seq dum{}; print_type(dum); }``````

 ```0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 9223372036854775808 4611686018427387904 2305843009213693952 1152921504606846976 576460752303423488 288230376151711744 144115188075855872 72057594037927936 36028797018963968 18014398509481984 9007199254740992 4503599627370496 2251799813685248 1125899906842624 562949953421312 281474976710656 140737488355328 70368744177664 35184372088832 17592186044416 8796093022208 4398046511104 2199023255552 1099511627776 549755813888 274877906944 137438953472 68719476736 34359738368 17179869184 8589934592 4294967296 2147483648 1073741824 536870912 268435456 134217728 67108864 33554432 16777216 8388608 4194304 2097152 1048576 524288 262144 131072 65536 32768 16384 8192 4096 2048 1024 512 256 128 64 32 16 8 4 2 1 Program ended with exit code: 0``` Are you taking a class, @sparki? I've never seen this stuff taught by an instructor.

Your first post builds the sequence correctly, but prints it in reverse.
Using the code in your first post, correct the problem by swapping line 32 and 33.
Last edited on @sparki
A multi-templated/variadic/multi-method/recursive structure and program is no mean feat. :)