Hello i'm learning C++11, I'm wondering how to make a constexpr 0 to n array, for example:
n = 5;
int array[] = {0 ... n};
so array may be {0, 1, 2, 3, 4, 5}
Hello i'm learning C++11, I'm wondering how to make a constexpr 0 to n array, for example:
n = 5;
int array[] = {0 ... n};
so array may be {0, 1, 2, 3, 4, 5}
Unlike those answers in the comments to your question, you can do this without compiler extensions.