[vtk-developers] std::auto_ptr replacement for modern compilers.
David Gobbi
david.gobbi at gmail.com
Mon Jun 20 10:59:11 EDT 2016
On Mon, Jun 20, 2016 at 8:17 AM, Ben Boeckel <ben.boeckel at kitware.com>
wrote:
>
> and our copy already has it:
>
>
> https://gitlab.kitware.com/third-party/jsoncpp/blob/master/src/lib_json/json_reader.cpp#L46
I'm fond of simple solutions like that. Since we know it works, we could
add the following to vtkConfigure.h.in, which is easier than adding a
try-compile:
#if __cplusplus >= 201103L || (defined(_CPPLIB_VER) && _CPPLIB_VER >= 520)
#define VTK_HAS_STD_UNIQUE_PTR
#endif
Those three source files can use this in order to avoid the compiler
warning (i.e. by using std::unique_ptr when available).
I don't think we should actively encourage the use of std::unique_ptr yet.
That can wait until we're ready to abandon the old compilers.
- David
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/vtk-developers/attachments/20160620/9edf97e2/attachment.html>
More information about the vtk-developers
mailing list