<div dir="ltr">There's definitely a place for std::unique_ptr in VTK, however.  There's lots of code that does local allocation with new/delete that could be cleaned up.<div><br></div><div>Event binding is one place where we should detect the use of shared_ptr, i.e. the templated vtkObject::AddObserver method.</div><div><br></div><div>I believe that the main thing holding us back from more widespread use of smart pointers is our rule for using forward declarations in VTK headers, rather than including other headers. Â  And it's a rule that I don't want to see changed.<br></div><div><br></div><div> - David</div><div><br><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Jan 17, 2017 at 9:04 AM, Robert Maynard <span dir="ltr"><<a href="mailto:robert.maynard@kitware.com" target="_blank">robert.maynard@kitware.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi,<br>
<br>
I believe that the VTK object reference counting model is not well<br>
suited to a transition to c++11 shared pointer design. It would<br>
require a redesign of how everyone constructs VTK classes ( New,<br>
ShallowCopy, etc ) with no clear gain. VTK already uses an atomic ref<br>
count, and we don't need the shared_ptr overhead of holding the<br>
destructor.<br>
<br>
I do see value in VTK providing pre-made destructors for<br>
std::shared_ptr, etc so that you can safely mix the two different<br>
types of reference counting.<br>
<div class="HOEnZb"><div class="h5"><br>
On Mon, Jan 16, 2017 at 4:47 PM, Alexis Girault<br>
<<a href="mailto:alexis.girault@kitware.com">alexis.girault@kitware.com</a>> wrote:<br>
> Awesome! Will there be any interest to transition to the c++11 smart<br>
> pointers (shared, weak, unique)?<br>
><br>
> Alexis<br>
><br>
> On Mon, Jan 9, 2017 at 5:18 PM, Robert Maynard <<a href="mailto:robert.maynard@kitware.com">robert.maynard@kitware.com</a>><br>
> wrote:<br>
>><br>
>> We have merged in the branch to require CMake 3.3 today. So I will be<br>
>> keeping an eye on the dashboard machines and updating machines over<br>
>> the next couple of days.<br>
>><br>
>> I also expect to have a MR open end of this week that will explicitly<br>
>> enable C++11 with a goal to have that merged in on Monday Jan 16.<br>
>><br>
>> On Wed, Jan 4, 2017 at 2:06 PM, Robert Maynard<br>
>> <<a href="mailto:robert.maynard@kitware.com">robert.maynard@kitware.com</a>> wrote:<br>
>> > As we start a new year, it is time to announce that we are planning on<br>
>> > rolling out a series of updates to VTK that are starting with the update<br>
>> > of the minimum required CMake version.<br>
>> ><br>
>> > We have chosen CMake 3.3 as the minimum required version for numerous<br>
>> > reasons,<br>
>> > the most important of those reasons being:<br>
>> ><br>
>> > - It is the first CMake release that offers C++11 support for all four<br>
>> > major<br>
>> >  Â compilers ( GCC / MSVC / Clang / XCode ). [1]<br>
>> ><br>
>> > - The CMake version is sufficiently new enough that it allows for a<br>
>> > cleaning<br>
>> >  Â of the existing CMake infrastructure. The current CMake minimum<br>
>> > version<br>
>> >  Â requires VTK to maintain forks of numerous FindPackages and Modules<br>
>> > that are<br>
>> >  Â part of newer CMake versions.<br>
>> ><br>
>> > - Supports HTTPS downloads, with all the official binaries come with<br>
>> > support.<br>
>> >  Â Allowing for migration of external data to a HTTPS only server.<br>
>> > Something we<br>
>> >  Â are going to require in the near future. [2]<br>
>> ><br>
>> > As mentioned above this year we have a series of upgrades planned to VTK<br>
>> > which<br>
>> > require moving the minimum CMake version to 3.3. The most significant<br>
>> > of these changes to all developers is the requirement of a C++11 capable<br>
>> > compiler.<br>
>> ><br>
>> > Yes you heard that correct, VTK is going to soon require a C++11 capable<br>
>> > compiler. To be more exact we are going to require a compiler that<br>
>> > understands<br>
>> > the significant majority of the C++11 language and runtime additions.<br>
>> > The exact<br>
>> > versions for each compiler have not been set in stone, but a rough<br>
>> > estimation<br>
>> > would be:<br>
>> >  Â - GCC 4.8+<br>
>> >  Â - Clang 3.3+<br>
>> >  Â - XCode 5.0+<br>
>> >  Â - MSVC 2013+<br>
>> > As we progress through the year, I expect a more concrete list of<br>
>> > supported<br>
>> > compilers will be determined and documented.<br>
>> ><br>
>> > Now the roll out for C++11 support is going to happen in multiple stages<br>
>> > with an initial plan being:<br>
>> ><br>
>> > Stage 1: We require CMake 3.3, upgrade all dashboards, work through<br>
>> > developer<br>
>> >  Â  Â  Â  Â  reported issues with the version bump<br>
>> ><br>
>> > Stage 2: Explicitly enable C++11 compiler flags during CMake<br>
>> > configuration. Again<br>
>> >  Â  Â  Â  Â  we will have to upgrade/retire dashboards, work through<br>
>> > developer<br>
>> >  Â  Â  Â  Â  reported issues.<br>
>> ><br>
>> > Stage 3: Update the VTK Coding Standards for C++11.<br>
>> ><br>
>> > Stage 4: Allow C++11 to be used in VTK ( outside currently permitted<br>
>> > usage ).<br>
>> ><br>
>> > Notes:<br>
>> ><br>
>> > 1 - If you are using a different compiler vendor than one of those<br>
>> > listed above<br>
>> >  Â  Â please see if it is currently supported<br>
>> >  Â  Â (<br>
>> > <a href="https://cmake.org/cmake/help/v3.7/manual/cmake-compile-features.7.html" rel="noreferrer" target="_blank">https://cmake.org/cmake/help/<wbr>v3.7/manual/cmake-compile-<wbr>features.7.html</a> ).<br>
>> >  Â  Â If the vendor is not explicitly listed please contact me, so we can<br>
>> > discuss<br>
>> >  Â  Â what options are available.<br>
>> ><br>
>> > 2 - <a href="https://data.kitware.com" rel="noreferrer" target="_blank">https://data.kitware.com</a> is transitioning to be the location for all<br>
>> >  Â  Â external data, and requires a SSL connection.<br>
>> ______________________________<wbr>_________________<br>
>> Powered by <a href="http://www.kitware.com" rel="noreferrer" target="_blank">www.kitware.com</a><br>
>><br>
>> Visit other Kitware open-source projects at<br>
>> <a href="http://www.kitware.com/opensource/opensource.html" rel="noreferrer" target="_blank">http://www.kitware.com/<wbr>opensource/opensource.html</a><br>
>><br>
>> Search the list archives at: <a href="http://markmail.org/search/?q=vtk-developers" rel="noreferrer" target="_blank">http://markmail.org/search/?q=<wbr>vtk-developers</a><br>
>><br>
>> Follow this link to subscribe/unsubscribe:<br>
>> <a href="http://public.kitware.com/mailman/listinfo/vtk-developers" rel="noreferrer" target="_blank">http://public.kitware.com/<wbr>mailman/listinfo/vtk-<wbr>developers</a><br>
>><br>
><br>
______________________________<wbr>_________________<br>
Powered by <a href="http://www.kitware.com" rel="noreferrer" target="_blank">www.kitware.com</a><br>
<br>
Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html" rel="noreferrer" target="_blank">http://www.kitware.com/<wbr>opensource/opensource.html</a><br>
<br>
Search the list archives at: <a href="http://markmail.org/search/?q=vtk-developers" rel="noreferrer" target="_blank">http://markmail.org/search/?q=<wbr>vtk-developers</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://public.kitware.com/mailman/listinfo/vtk-developers" rel="noreferrer" target="_blank">http://public.kitware.com/<wbr>mailman/listinfo/vtk-<wbr>developers</a><br>
<br>
</div></div></blockquote></div><br></div></div></div>