<div dir="ltr"><div>-1<br><br>I do not like adding macros. They obscure what is actually happening.Macros are useful when they remove significant amounts of duplicate code.<br><br></div>BTW. the some VTK developers agree with me.<br>
</div><div class="gmail_extra"><br><br><div class="gmail_quote">On Thu, Aug 15, 2013 at 4:01 PM, Johnson, Hans J <span dir="ltr">&lt;<a href="mailto:hans-johnson@uiowa.edu" target="_blank">hans-johnson@uiowa.edu</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">



<div style="font-size:14px;font-family:Calibri,sans-serif;word-wrap:break-word">
<div>Brad,</div>
<div><br>
</div>
<div>Could these be macros?</div>
<div><br>
</div>
<div>#if C++11</div>
<div>   DEFAULT_CONSTRUCTOR {}</div>
<div>#else</div>
<div>   DEFAULT_CONSTRUCTOR = default;</div>
<div>#end</div>
<div><br>
</div>
<span>
<div style="border-right:medium none;padding-right:0in;padding-left:0in;padding-top:3pt;text-align:left;font-size:11pt;border-bottom:medium none;font-family:Calibri;border-top:#b5c4df 1pt solid;padding-bottom:0in;border-left:medium none">

<span style="font-weight:bold">From: </span>Bradley Lowekamp &lt;<a href="mailto:blowekamp@mail.nih.gov" target="_blank">blowekamp@mail.nih.gov</a>&gt;<br>
<span style="font-weight:bold">Date: </span>Thursday, August 15, 2013 2:51 PM<br>
<span style="font-weight:bold">To: </span>Matt McCormick &lt;<a href="mailto:matt.mccormick@kitware.com" target="_blank">matt.mccormick@kitware.com</a>&gt;<br>
<span style="font-weight:bold">Cc: </span>Slicer Development &lt;<a href="mailto:slicer-devel@bwh.harvard.edu" target="_blank">slicer-devel@bwh.harvard.edu</a>&gt;, ITK &lt;<a href="mailto:insight-developers@itk.org" target="_blank">insight-developers@itk.org</a>&gt;<br>

<span style="font-weight:bold">Subject: </span>Re: [Insight-developers] [slicer-devel] Improved readability of VTK derived class - What would you think of VTK_DISABLE_COPY macro ?<br>
</div><div><div class="h5">
<div><br>
</div>
<div>
<div style="word-wrap:break-word">New with C++11 you can explicitly delete these methods. It may give better compiler error messages. It may be worth the try compile to give a useful error message to users.
<div><br>
</div>
<div>I messed a bit with in in SimpleITK, though I don&#39;t think I turned it on:</div>
<div><a href="https://github.com/SimpleITK/SimpleITK/blob/master/Code/Common/include/sitkNonCopyable.h#L60" target="_blank">https://github.com/SimpleITK/SimpleITK/blob/master/Code/Common/include/sitkNonCopyable.h#L60</a></div>

<div><br>
</div>
<div>I think it would make the change to the newer C++ code easier.</div>
<div><br>
</div>
<div>Brad</div>
<div><br>
<div>
<div>On Aug 15, 2013, at 3:43 PM, Matt McCormick &lt;<a href="mailto:matt.mccormick@kitware.com" target="_blank">matt.mccormick@kitware.com</a>&gt; wrote:</div>
<br>
<blockquote type="cite">
<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><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" target="_blank">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" target="_blank">
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>
_______________________________________________<br>
slicer-devel mailing list<br>
<a href="mailto:slicer-devel@bwh.harvard.edu" target="_blank">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" target="_blank">
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></blockquote>
</div>
<br>
</div>
</div>
</div>
</div></div></span><br>
<br>
<hr>
Notice: This UI Health Care e-mail (including attachments) is covered by the Electronic Communications Privacy Act, 18 U.S.C. 2510-2521, is confidential and may be legally privileged.  If you are not the intended recipient, you are hereby notified that any
 retention, dissemination, distribution, or copying of this communication is strictly prohibited.  Please reply to the sender that you have received the message in error, then delete it.  Thank you.
<hr>
</div>

<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>
Kitware offers ITK Training Courses, for more information visit:<br>
<a href="http://kitware.com/products/protraining.php" target="_blank">http://kitware.com/products/protraining.php</a><br>
<br>
Please keep messages on-topic and check the ITK FAQ at:<br>
<a href="http://www.itk.org/Wiki/ITK_FAQ" target="_blank">http://www.itk.org/Wiki/ITK_FAQ</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://www.itk.org/mailman/listinfo/insight-developers" target="_blank">http://www.itk.org/mailman/listinfo/insight-developers</a><br>
<br></blockquote></div><br><br clear="all"><br>-- <br>Unpaid intern in BillsBasement at noware dot com<br>
</div>