[vtk-developers] Smart pointer declaration macro?

David Doria daviddoria+vtk at gmail.com
Fri Jan 8 15:15:24 EST 2010


I've seen the use of something like this:

#define SPNEW(instance, type) \
vtkSmartPointer<type> instance = vtkSmartPointer<type>::New();

in many of the tests and elsewhere. It seems like a reasonable savings
of a whole bunch of characters that appears many many times in most
functions. Could we standardize something like this so it can be used
universally without having to see this little #define in every file it
is used in?

Thoughts?

David D.



More information about the vtk-developers mailing list