<div dir="ltr"><div>Hi Andrew,<br><br></div>We have had a few discussions about this and here is (roughly) where I think things stand. (To the list: feel free to correct/expand this).<br><div>> So I have two questions:</div><div>> 1) How do we handle future
proofing in this case? Most importantly, we need to keep std::auto_ptr
for older compilers but should move to either std::unique_ptr and/or
possibly std::shared_ptr. Is there a define that we can use?</div><div><br></div><div>Yes std::unique_ptr is the right replacement, but we should check if the compiler/library supports it and fall back to std::auto_ptr. I don't know of a define that could be used to test this, though one could be added.<br> <br></div><div>> Finally:</div><div>> 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)?</div><div><br></div><div>This was a long discussion, but the summary is this: vtkSmartPointer assumes that the object itself is reference counted internally and will delete itself when that count reaches 0. std::shared_ptr assumes that it needs to keep the reference count and delete the object when that reaches 0. These two different takes on reference counting are hard to reconcile and there isn't really a way to easily migrate to use std::shared_ptr. It is also uncertain if we want to...<br><br></div><div>Shawn<br></div><br><br><div class="gmail_extra"><br></div></div>