Hi,

I have just wrote the following code ( only showing part of class ) :

Qt Code:
  1. template<class T> class DAPointer {
  2. T* m_pPtr;
  3. public:
  4. inline DAPointer( T* p=0 ) : m_pPtr(p){}
  5. inline ~DAPointer() { m_pPtr = NULL; }
  6. // etc....
  7. };
To copy to clipboard, switch view to plain text mode 

What it is meant to do is just set a pointer to NULL after I've deleted it.

For example :

Qt Code:
  1. DAPointer<TestObject>obj;
  2. obj = new TestObject;
  3. delete obj; // <---------------- error : cannot convert from DAPointer<T> to void *
To copy to clipboard, switch view to plain text mode 

What am I missing in order to allow the delete function not to give conversion error?

Kind regards,
Steve