title: C++ functors and default parameters
body: <p>I've wrote a functor library (based on the tutorial at: <a href="http://www.tutok.sk/fastgl/callback.html" rel="nofollow">http://www.tutok.sk/fastgl/callback.html</a>).</p>
  
  <p>Currently, I can write the following code:</p>
  
  <pre><code>class MyClass
  {
  public:
      void Test(int a,int b);
  };
  
  MyClass c;
  Functor2&lt;void,int,int&gt; f=makeFunctor(c,&amp;MyClass::Test);
  ...
  f(1,2);
  </code></pre>
  
  <p>I would like to add another feature so I can bind parameters with the actual function (to pass it forward), so for example:</p>
  
  <pre><code>Functor0&lt;void&gt; f=makeFunctor(c,&amp;MyClass::Test,3,4);
  ...
  f(); // this will use the default parameters 3,4
  </code></pre>
  
  <p>I know that boost has that functionality, but I don't want to use that - I would like to write it myself.</p>
  
  <p>My question is how to define a functor where I can also pass default arguments to be used in the call itself. The reason I don't want to use boost nor std++ is because this code is cross platform and will be used on some platforms which do not have boost.</p>