title: How to generalize a class based on operator() arguments?
body: <p>I have a class that is supposed to forward some arguments to a functor, but doing some additional stuff.</p>
  
  <pre><code>class SemaphoredEventRouterObserver {
     My_Semaphore m_semaphore;
     mywrapper_Function&lt;void (*)(const Event &amp;)&gt; callback;
     SemaphoredEventRouterObserver(My_Semaphore semaphore, mywrapper_Function&lt;void (*)(const Event &amp;)&gt; o_callback) : m_semaphore(semaphore) {
        callback = o_callback;
     }
     void operator()(const Event &amp; event) {
        callback(event);
        semaphone.post();
     }
  }    
  </code></pre>
  
  <p>The problem is I might have to create dozens of classes like this, because for other functors the arguments vary, so instead of receiving <code>const Event &amp; event</code>, I could receive <code>string arg</code>, <code>int c</code>, <code>Myclass abc</code> or anything else.</p>
  
  <p>Is it possible to create a template class for this? I am using just stl and I cannot use boost, although I would be curious to see answers related to boost as well.</p>