<div dir="ltr">I agree with Robert. I'd rather see the explicit lions rather than a macro. Makes code easier to follow for novices.<div><br></div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Wed, Jul 24, 2013 at 12:33 PM, 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">Personally I don't see enough complaints about people forgetting to<br>
follow the rule of three to add another macro helper to VTK.<br>
We have a smoke test that does verify that all classes that derive<br>
from vtkObject have private copy constructor and copy assignment<br>
operator.<br>
<div class="HOEnZb"><div class="h5"><br>
<br>
On Wed, Jul 24, 2013 at 11:55 AM, Jean-Christophe Fillion-Robin<br>
<<a href="mailto:jchris.fillionr@kitware.com">jchris.fillionr@kitware.com</a>> wrote:<br>
> Would it make sense to provide a VTK_DISABLE_COPY() macro ?  (Similar to<br>
> what is done within Qt with Q_DISABLE_COPY [1])<br>
><br>
> [1] <a href="http://qt-project.org/doc/qt-5.0/qtcore/qobject.html#Q_DISABLE_COPY" target="_blank">http://qt-project.org/doc/qt-5.0/qtcore/qobject.html#Q_DISABLE_COPY</a><br>
><br>
><br>
> On Wed, Jul 24, 2013 at 11:48 AM, Marcus D. Hanwell<br>
> <<a href="mailto:marcus.hanwell@kitware.com">marcus.hanwell@kitware.com</a>> wrote:<br>
>><br>
>> 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>
>><br>
>> On Wed, Jul 24, 2013 at 11:06 AM, Robert Maynard<br>
>> <<a href="mailto:robert.maynard@kitware.com">robert.maynard@kitware.com</a>> wrote:<br>
>> > 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">sean@rogue-research.com</a>><br>
>> > wrote:<br>
>> >> Hi all,<br>
>> >><br>
>> >> So I'm looking at the clang warnings on Rogue7, but need C++ help<br>
>> >> before I can proceed further.  We have two similar warnings, repeated for<br>
>> >> several classes:<br>
>> >><br>
>> >> VTK/Common/DataModel/vtkBond.h:30:3: warning: definition of implicit<br>
>> >> copy constructor for 'vtkBond' is deprecated because it has a user-declared<br>
>> >> destructor [-Wdeprecated]<br>
>> >>   ~vtkBond();<br>
>> >>   ^<br>
>> >><br>
>> >> VTK/Common/Math/vtkQuaternion.h:201:8: warning: definition of implicit<br>
>> >> copy constructor for 'vtkQuaternion<float>' is deprecated because it has a<br>
>> >> 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<br>
>> >> constructors is now deprecated if 1) you provide a user-declared destructor<br>
>> >> 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,<br>
>> >> but VTK's coding standards gives me pause: "Classes should have protected<br>
>> >> constructors and destructors, and privately declared but unimplemented copy<br>
>> >> constructor and assignment operator. Rationale: VTK’s reference counting<br>
>> >> implementation depends on carefully controlling each object’s reference<br>
>> >> 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">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<br>
>> >> <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<br>
>> > <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<br>
>> <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>
><br>
><br>
> --<br>
> <a href="tel:%2B1%20919%20869%208849" value="+19198698849">+1 919 869 8849</a><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>Unpaid intern in BillsBasement at noware dot com<br>
</div>