[vtk-developers] RFC: vtkScopedPointer - a new hope?
tom fogal
tfogal at sci.utah.edu
Mon Jan 24 15:41:22 EST 2011
"Marcus D. Hanwell" <marcus.hanwell at kitware.com> writes:
> Some of you may remember my dreams of a concise way of initializing
> VTK objects, that would go out of scope and be destroyed at the
> appropriate time. Inspired by the Qt scoped pointer, [. . .]
>
> http://review.source.kitware.com/759
scoped (and other) smart pointers were introduced with tr1, back in
2003 IIRC. Further boost has had this for quite some time:
http://www.boost.org/doc/libs/1_45_0/libs/smart_ptr/scoped_ptr.htm?sess=94fbb4fa5cfd2b2071c3be193acb355d
I realize that vtk is a bit stuck because it has already shipped some
smart pointers, and thus probably must continue to do so for some time
due to backward compat requirements, but I'd discourage *extending*
the trend. This is a painful interop problem, especially with larger
software systems -- there's probably some C++ platitude that states,
"Every library eventually evolves a smart pointer implementation."
Or there is now, at least.
-tom
More information about the vtk-developers
mailing list