title: Is there a way to handle a variable number of parameters in a template class?
body: <p>I have a set of callback classes that I use for handling callbacks with variable numbers of parameters. Right now I have about 6 different instances of it to handle differing numbers of arguments. Is there a way to make one instance than can handle a variable number of arguments?? Ultimately I would love to have each parameter be a POD type or a class pointer, or a struct pointer. Any ideas?</p>
  
  <pre><code>template &lt;class T&gt;
  class kGUICallBackPtr
  {
  public:
      kGUICallBackPtr() {m_obj=0;m_func=0;}
      void Set(void *o,void (*f)(void *,T *));
      inline void Call(T *i) {if(m_func) m_func(m_obj,i);}
      inline bool IsValid(void) {return (m_func!=0);}
  private:
      void *m_obj;
      void (*m_func)(void *,T *);
  };
  
  
  template &lt;class T,class U&gt;
  class kGUICallBackPtrPtr
  {
  public:
      kGUICallBackPtrPtr() {m_obj=0;m_func=0;}
      void Set(void *o,void (*f)(void *,T *,U *));
      inline void Call(T *i, U *j) {if(m_func) m_func(m_obj,i,j);}
      inline bool IsValid(void) {return (m_func!=0);}
  private:
      void *m_obj;
      void (*m_func)(void *,T *,U *j);
  };
  </code></pre>