Winterdom

In C++/CLI, there's better support at the language level for IDisposable. You now define a type that implements IDisposable by simply adding a destructor to the type:


public ref class File
{
public:
   ~File()
   {
      // dispose unmanaged stream
   }
};

Just by doing that, the compiler will mark your class as implemeting IDisposable. The visibility of your IDisposable::Dispose() implementation on the generated class will depend on the visibility of your destructor method.

.: tomasr | 2004-10-10 18:45:03 :.