<div dir="ltr">Would it make sense to provide a VTK_DISABLE_COPY() macro ? (Similar to what is done within Qt with Q_DISABLE_COPY [1])<div class="gmail_extra"><br></div><div class="gmail_extra">[1] <a href="http://qt-project.org/doc/qt-5.0/qtcore/qobject.html#Q_DISABLE_COPY">http://qt-project.org/doc/qt-5.0/qtcore/qobject.html#Q_DISABLE_COPY</a><br>
<br><div class="gmail_quote">On Wed, Jul 24, 2013 at 11:48 AM, Marcus D. Hanwell <span dir="ltr"><<a href="mailto:marcus.hanwell@kitware.com" target="_blank">marcus.hanwell@kitware.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">I agree with Rob, and can take care of putting a patch together for<br>
the classes you call out. The rules outlined only make sense for<br>
vtkObject derived classes, we should provide clear guidelines for<br>
those that are not part of that hierarchy too.<br>
<div><br>
On Wed, Jul 24, 2013 at 11:06 AM, Robert Maynard<br>
<<a href="mailto:robert.maynard@kitware.com" target="_blank">robert.maynard@kitware.com</a>> wrote:<br>
</div><div><div>> The VTK coding standards should be amended to state that those rules<br>
> are only valid for classes that derive from vtkObject.<br>
><br>
> Classes like vtkBond, vtkTuple, vtkBoundingBox all which don't inherit<br>
> from vtkObject should follow the rule of three and implement the copy<br>
> and assignment constructor if they implement a destructor.<br>
><br>
> On Wed, Jul 24, 2013 at 10:50 AM, Sean McBride <<a href="mailto:sean@rogue-research.com" target="_blank">sean@rogue-research.com</a>> wrote:<br>
>> Hi all,<br>
>><br>
>> So I'm looking at the clang warnings on Rogue7, but need C++ help before I can proceed further. We have two similar warnings, repeated for several classes:<br>
>><br>
>> VTK/Common/DataModel/vtkBond.h:30:3: warning: definition of implicit copy constructor for 'vtkBond' is deprecated because it has a user-declared destructor [-Wdeprecated]<br>
>> ~vtkBond();<br>
>> ^<br>
>><br>
>> VTK/Common/Math/vtkQuaternion.h:201:8: warning: definition of implicit copy constructor for 'vtkQuaternion<float>' is deprecated because it has a user-declared copy assignment operator [-Wdeprecated]<br>
>> void operator=(const vtkQuaternion<T>& q);<br>
>> ^<br>
>><br>
>> From what I can tell, in C++11, the implicit generation of copy constructors is now deprecated if 1) you provide a user-declared destructor or 2) you provide a user-declared copy assignment operator.<br>
>> <<a href="http://stackoverflow.com/a/11255258" target="_blank">http://stackoverflow.com/a/11255258</a>><br>
>><br>
>> So it would seem a solution is to provide an explicit copy constructor, but VTK's coding standards gives me pause: "Classes should have protected constructors and destructors, and privately declared but unimplemented copy constructor and assignment operator. Rationale: VTK’s reference counting implementation depends on carefully controlling each object’s reference count".<br>
>><br>
>> So now I'm not sure how to proceed...<br>
>><br>
>> Thanks,<br>
>><br>
>> --<br>
>> ____________________________________________________________<br>
>> Sean McBride, B. Eng <a href="mailto:sean@rogue-research.com" target="_blank">sean@rogue-research.com</a><br>
>> Rogue Research <a href="http://www.rogue-research.com" target="_blank">www.rogue-research.com</a><br>
>> Mac Software Developer Montréal, Québec, Canada<br>
>> _______________________________________________<br>
>> Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
>><br>
>> Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
>><br>
>> Follow this link to subscribe/unsubscribe:<br>
>> <a href="http://www.vtk.org/mailman/listinfo/vtk-developers" target="_blank">http://www.vtk.org/mailman/listinfo/vtk-developers</a><br>
>><br>
> _______________________________________________<br>
> Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
><br>
> Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
><br>
> Follow this link to subscribe/unsubscribe:<br>
> <a href="http://www.vtk.org/mailman/listinfo/vtk-developers" target="_blank">http://www.vtk.org/mailman/listinfo/vtk-developers</a><br>
><br>
_______________________________________________<br>
Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
<br>
Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://www.vtk.org/mailman/listinfo/vtk-developers" target="_blank">http://www.vtk.org/mailman/listinfo/vtk-developers</a><br>
<br>
</div></div></blockquote></div><br><br clear="all"><div><br></div>-- <br><a href="tel:%2B1%20919%20869%208849" value="+19198698849" target="_blank">+1 919 869 8849</a><br>
</div></div>