I currently have a problem, VS2010 nags that "TFunctionPointer" used in the constructor of "Nuke" & as datamember is undefined. Could someone please explain to me why this is ? Any help is very much appreciated.
template<typename T>
typedef void (T::* TFunctionPointer)();
class Nuke
{
public:
Nuke( TFunctionPointer pFunction );
virtual ~Nuke();
private:
TFunctionPointer m_pFunction;
};
// EDIT
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.
// EDIT
Apparently Boost::shared_ptr is what I was looking for.