#include <iostream>
#include <cmath>
#include <utility>
#include <array>

using namespace std;

template <int p>
double power(double val) {
    return pow(val,p);
}

template <size_t ...powers>
constexpr auto make_power_funcs(index_sequence<powers...>) {
    array<double(*)(double),256> arr = { &power<powers>... };
    return arr;
}

constexpr auto power_funcs = make_power_funcs(make_index_sequence<256>());

int main ()
{
    cout << power_funcs[2](5) << endl;
}