title: Template Member Function Pointers
body: <p>I currently have a problem, VS2010 nags that "TFunctionPointer" used in the constructor of "Nuke" &amp; as datamember is undefined. Could someone please explain to me why this is ? Any help is very much appreciated.</p>
  
  <pre><code>template&lt;typename T&gt;
  typedef void (T::* TFunctionPointer)();
  
  class Nuke
  {
  public:
      Nuke( TFunctionPointer pFunction );
      virtual ~Nuke();
  
  private:
      TFunctionPointer m_pFunction;
  
  };
  </code></pre>
  
  <p>// EDIT</p>
  
  <p>What I'm trying to do is allow a function pointer to any type of class to be stored and called on destruction of the Nuke object. A twist on RAII. But I guess it isn't possible. Thanks for the help guys.</p>
  
  <p>// EDIT</p>
  
  <p>Apparently Boost::shared_ptr is what I was looking for.</p>