<br><br><div class="gmail_quote">On Mon, Jul 23, 2012 at 8:55 PM, Steve Ramsey <span dir="ltr"><<a href="mailto:clang@lucena.com" target="_blank">clang@lucena.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
On Jul 23, 2012, at 9:52 AM, Matthieu Monrocq wrote:<br>
> So I would argue against the owner here: what is the cost, really, of declaring the destructor virtual ? (especially since there is already another virtual method anyway)<br>
<br>
Well, if you want to avoid deprecated behavior, once you declare a virtual destructor, even if it’s just defaulted, you also have to declare the five other special member functions to maintain the existing behavior.<br>
<br></blockquote><div><br>Which is probably a good thing, by the way.<br><br>The default (copy|move) (constructor|assignment operator) open the gate to undiagnosed object slicing, so in the worst case they would have to be protected (+defaulted) and in the best case disabling is just a bonus.<br>
<br>-- Matthieu<br><br> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Which reminds me: I don’t follow the standard proceedings at all, but why shouldn’t the implicitly declared destructor in a class with a virtual member function not be made virtual by default? The only other option that makes sense is to make it protected and nonvirtual, though that is probably less often what the class designer wants. I thought this might change in C++11, and find it makes even more sense given the new rules about special member functions.<br>

<span class="HOEnZb"><font color="#888888"><br>
                        Steve<br>
</font></span><br>
P.S. If it were me, I’d just suck it up and fix the base class. The maintainer here seems to be spending more time arguing than it would take to implement the correct action.<br>
<br>
</blockquote></div><br>