title: VS2010 C++ variadic template example
body: <p>I have a class template and I can't seem to figure out how to perform a Variadic Template style instantiation.</p>
  
  <p>Here is the "code" so far of what I'm looking for:</p>
  
  <pre><code>template&lt;typename _Classname, typename... Args&gt;
  class CFunctorStartExT 
  {
    friend class CXXFactory;
  protected:
    template&lt;typename U&gt;
    CFunctorStartExT(typename U&amp; _functor, Args&amp;... args) :
      m_Functor(_functor),
      m_args(args)
    {
    }
    virtual bool ProcessLoop(CSomeClass* pThread)
    {
      return m_Functor(pThread, m_args);
    }
  
  protected:
    _Classname&amp; m_Functor;
    Args... m_args;
  };
  </code></pre>
  
  <p>Obviously this won't compile :). The idea is to create a class that can store the values passed in (if any.. it might just have _Classname/U defined) on the constructor so they can be retrieved later to pass to m_Functor in another function.</p>
  
  <p>First: can Variadic Template even be done in VS2010? I am getting compile problems just with the template declaration <code>error C2143: syntax error : missing ',' before '...'</code> from the line <code>template&lt;typename _Classname, typename... Args&gt;</code></p>
  
  <p>Second, can what I am trying to accomplish be done? Thanks!</p>