#include <iostream>
#include <functional>
#include <map>
using namespace std;

enum E { A, B };

struct Some {
    map<E,function<void()>> m;

    Some ();
    void process(E);
    template <int N> void func();
};

template<> void Some::func<E::A>() {
   cout << "A\n";
}

template<> void Some::func<E::B>() {
   cout << "B\n";
}

Some::Some ()
 : m (
      {
         {E::A, bind(&Some::func<E::A>, this)}
        ,{E::B, bind(&Some::func<E::B>, this)}
      }
     )
{
}

void Some::process(E x) {
   m[x]();
}
 
int main() {
	Some foo;
    foo.process(E::A);
    foo.process(E::B);
}