#include <iostream>

using namespace std;

//array generator

const int ARRAY_SIZE = 5;

template <int N, int I=N-1>
struct Table : Table<N, I-1>
{
    static const int dummy;
};

template <int N>
struct Table<N, 0>
{
    static const int dummy;
    static int array[N];
};

template <int N, int I>
const int Table<N, I>::dummy = Table<N, 0>::array[I] = I*I+ 0*Table<N, I-1>::dummy;

template <int N>
int Table<N, 0>::array[N];

template class Table<ARRAY_SIZE>;


//test

int main()
{

    const int *compilerFilledArray = Table<ARRAY_SIZE>::array;
    for (int i=0; i < ARRAY_SIZE; ++i)
        std::cout<<compilerFilledArray[i]<<std::endl;

    return 0;
}
