[vtk-developers] Smart pointer declaration macro?

Timothy M. Shead tshead at sandia.gov
Thu Jan 28 11:01:34 EST 2010


> 4. Make a new vtkLocalPointer type that is the same as vtkSmartPointer
> but always creates an instance of the object.
> vtkLocalPointer<vtkClass> c;

Muddying the waters further, I might suggest vtkScopedPointer as a 
better name for this alternative, one that is at least consistent with 
boost.

Further, if I were going to create a new smart pointer class, I'd be 
inclined to cleanup the API a bit ... I find that between Take(), 
TakeReference(), and the current assignment operator that it always 
seems to take me two tries to use it without leaks / premature destruction.

Cheers,
Tim




More information about the vtk-developers mailing list