[vtk-developers] std::auto_ptr replacement for modern compilers.

Ben Boeckel ben.boeckel at kitware.com
Mon Jun 20 10:17:35 EDT 2016


On Sun, Jun 19, 2016 at 17:35:00 +1000, Andrew Maclean wrote:
> A cursory search reveals that the following VTK sources use std::auto_ptr:
> ./ThirdParty/jsoncpp/vtkjsoncpp/jsoncpp.cpp

This seems to be handled by upstream:

    https://github.com/open-source-parsers/jsoncpp/blob/96d32b37eac518147f3d733012a6c28db3720328/src/lib_json/json_writer.cpp#L78

and our copy already has it:

    https://gitlab.kitware.com/third-party/jsoncpp/blob/master/src/lib_json/json_reader.cpp#L46

> Finally:
> 2) vtkSmartPointer ... how does this fit in? To me it seems this similar to
> std::shared_ptr. Could vtkSmartPointer just be a wrapper around
> std::shared_ptr for new compilers (C++11 and newer)?

As Shawn mentioned, vtkSmartPointer is not a std::shared_ptr.
boost::intrusive_ptr would be more a more accurate replacement.

--Ben


More information about the vtk-developers mailing list