#include <iostream>
using namespace std;

template <int N>
struct pow2 
{
    enum { value = 2 * pow2<N - 1>::value };
};

template <>
struct pow2<0> 
{
    enum { value = 1 };
};

int  main()
{
    const int x = pow2<4>::value; // == 16
    const int y = pow2<0>::value; // == 1
    char arr[x]; // Because x is constant
    cout << "Array size is " << sizeof arr << endl;
}

