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

Ken Martin ken.martin at kitware.com
Tue Jun 21 11:00:03 EDT 2016


Yes! If possible I'd like us to avoid any try compile statements and
especially any try run statements. When building multi-architecture
frameworks configured try compile values cause all sorts of problems (there
is one set of headers for a framework even though it may contain multiple
architectures). Replacing them with conditionals in the headers is great if
it can be done. I know Brad King has done some of that for VTK already.
Maybe there are other solutions as well.




On Mon, Jun 20, 2016 at 7:34 PM, Andrew Maclean <andrew.amaclean at gmail.com>
wrote:

> Ben, David,
>
> This is a much better suggestion than a try compile. I'll create a topic
> for this.
>
> Thanks
>    Andrew
>
> On Tue, Jun 21, 2016 at 12:59 AM, David Gobbi <david.gobbi at gmail.com>
> wrote:
>
>> 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
>>
>
>
>
> --
> ___________________________________________
> Andrew J. P. Maclean
>
> ___________________________________________
>
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Search the list archives at: http://markmail.org/search/?q=vtk-developers
>
> Follow this link to subscribe/unsubscribe:
> http://public.kitware.com/mailman/listinfo/vtk-developers
>
>
>


-- 
Ken Martin PhD
Chairman & CFO
Kitware Inc.
28 Corporate Drive
Clifton Park NY 12065
518 371 3971

This communication, including all attachments, contains confidential and
legally privileged information, and it is intended only for the use of the
addressee.  Access to this email by anyone else is unauthorized. If you are
not the intended recipient, any disclosure, copying, distribution or any
action taken in reliance on it is prohibited and may be unlawful. If you
received this communication in error please notify us immediately and
destroy the original message.  Thank you.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/vtk-developers/attachments/20160621/efe85033/attachment.html>


More information about the vtk-developers mailing list