title: Member function callback
body: <p>Present is a class to register functions as callbacks.</p>
  
  <pre><code>class Action {
  private:
      static std::multimap&lt;std::string, std::function&lt;void()&gt;&gt; actions;
  public:
      static void registerAction(const std::string &amp;key, std::function&lt;void()&gt; action);
  }
  </code></pre>
  
  <p>Obviously it can not register member functions, as function pointer objects to member functions require the class to be specified, but every class should be able to register their  functions. <code>std::function&lt;void(Class&amp;)&gt;</code></p>
  
  <p>Using a template system, I couldn't access all actions from one "instance" of the static class I suppose. How could this be realized?</p>
  
  <p><em>Example how it should look like:</em></p>
  
  <pre><code>class B {
  public:
      B() {
          Action::registerAction("some_action", &amp;callMe);
      }
  
      void callMe(){}
  }
  </code></pre>