<div dir="ltr">Hi Jc,<div><br></div><div>I like the idea -- it is more explicit, and it saves time.  What do members of the ITK community think of an itkDisableCopy(MyClass) macro?</div><div><br></div><div>Thanks,</div><div>
Matt</div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Thu, Aug 15, 2013 at 6:11 PM, Jean-Christophe Fillion-Robin <span dir="ltr">&lt;<a href="mailto:jchris.fillionr@kitware.com" target="_blank">jchris.fillionr@kitware.com</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Hi Folks, <div><br></div><div>On the VTK developer list, I recently discussed the introduction of a new VTK macro named &quot;VTK_DISABLE_COPY&quot; [1][2] that would allow to easily disable assignment and copy constructor in VTK class deriving from vtkObject. </div>


<div><br></div><div><br></div><div>Note that disabling these constructors for class deriving from vtkObject IS mandatory, it has to be done. You probably already copied this two constructor lines over and over ... </div>


<div><br></div><div><br></div><div>This macro would be similar to what is done in Qt with Q_DISABLE_COPY. For details [3]</div><div><br></div><div><br></div><div>For example, to declare the class MyClass, you would do .... </div>


<div><br></div><div>// -----------------</div><div><div>class MyClass : public vtkObject</div><div>{</div><div><br></div><div>  private:</div><div>    VTK_DISABLE_COPY(MyClass)</div><div>};</div><div>// -----------------<br>


</div><div><br></div><div><br></div><div><br></div><div>instead of </div><div><br></div><div><br></div><div><br></div><div>// -----------------<br></div><div>class MyClass : public vtkObject</div><div>{</div>

<div><br></div><div>  private:</div><div>     MyClass(const MyClass &amp;);</div><div>     MyClass &amp;operator=(const MyClass &amp;);</div><div>};</div></div><div>// -----------------<br></div><div><br></div><div><br></div>


<div><br></div><div>The more people reply to this email, the more chance we will have to see this macro added to VTK6. </div><div><br></div><div><br></div><div>Let us know what you think.</div><div>

<br></div><div><br></div><div>Thanks</div><div>Jc</div><div><br></div><div><br></div><div>[1] <a href="http://vtk.1045678.n5.nabble.com/Implicit-copy-constructors-in-VTK-tp5722193p5722205.html" target="_blank">http://vtk.1045678.n5.nabble.com/Implicit-copy-constructors-in-VTK-tp5722193p5722205.html</a></div>


<div><br></div><div>[2] <a href="http://vtk.1045678.n5.nabble.com/Implicit-copy-constructors-in-VTK-tp5722193p5722217.html" target="_blank">http://vtk.1045678.n5.nabble.com/Implicit-copy-constructors-in-VTK-tp5722193p5722217.html</a></div>


<div><br></div><div>[3] <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><span class="HOEnZb"><font color="#888888"><br clear="all">
<div><br></div>-- <br><a href="tel:%2B1%20919%20869%208849" value="+19198698849" target="_blank">+1 919 869 8849</a><br>


</font></span></div></div>
<br>_______________________________________________<br>
slicer-devel mailing list<br>
<a href="mailto:slicer-devel@bwh.harvard.edu">slicer-devel@bwh.harvard.edu</a><br>
<a href="http://massmail.spl.harvard.edu/mailman/listinfo/slicer-devel" target="_blank">http://massmail.spl.harvard.edu/mailman/listinfo/slicer-devel</a><br>
To unsubscribe: send email to <a href="mailto:slicer-devel-request@massmail.spl.harvard.edu">slicer-devel-request@massmail.spl.harvard.edu</a> with unsubscribe as the subject<br>
<a href="http://www.slicer.org/slicerWiki/index.php/Documentation/Nightly/Developers/FAQ" target="_blank">http://www.slicer.org/slicerWiki/index.php/Documentation/Nightly/Developers/FAQ</a><br></blockquote></div><br></div>