某過去ログ見ててこんなの(↓)思い付いたんですが、
配列の初期化を、コンパイル時に自動的に生成する方法って無いですか?

#include <iostream>
#include <vector>
using namespace std;

typedef void __cdecl FUNC(void);
typedef FUNC* PFUN ;
template<int n> struct f{ static FUNC f_; };

enum Id{ MOGE, HOGE, HAGE, SAGE, maxId };
template<MOGE> void f<id>::f_(void) { cout<<"MOGE"<<endl; }
template<HOGE> void f<id>::f_(void) { cout<<"HOGE"<<endl; }
template<HAGE> void f<id>::f_(void) { cout<<"HAGE"<<endl; }
template<SAGE> void f<id>::f_(void) { cout<<"SAGE"<<endl; }

// ↓を自動化したい!
PFUN funcTable[maxId] = { f<0>::f_, f<1>::f_, f<2>::f_, f<3>::f_ };

void main()
{
for(int k=0; k<maxId; ++k ) funcTable[k]();
}