<div class="gmail_quote"><div class="gmail_quote">On 18 March 2012 06:42, Andrei Alexandrescu <span dir="ltr"><<a href="mailto:SeeWebsiteForEmail@erdani.org">SeeWebsiteForEmail@erdani.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
<div class="im">On 3/17/12 9:24 PM, Manu wrote:<br><blockquote class="gmail_quote" style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
Yeah, I'm not really into that. I group things conceptually.<br>Either way, I've never written a class where non-virtuals don't outweigh<br>virtuals in the realm of 20:1.<br></blockquote><br></div>Then probably struct is what you're looking for.</blockquote>
<div><br></div><div>No, I definitely want a class. ref type, gc mem, etc.</div><div>struct doesn't support virtual at all. I have 2 virtuals, this particular class has around 50 public methods, almost all of which are trivial accessors, called extremely heavily in hot loops. More similar classes to come.</div>
<div><br></div><div>I've never in 15 years seen a large-ish class where the majority of methods are virtual. Who writes code like that? It's never come up in my industry at least.</div><div>Maybe you'll occasionally see it in a small interface class, but D has real interfaces...</div>
<div><br></div></div></div><div class="gmail_quote"><br></div><div class="gmail_quote">On 18 March 2012 11:00, David Nadlinger <span dir="ltr"><<a href="mailto:see@klickverbot.at">see@klickverbot.at</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="im">Is this even possible without LTO/WPO? Extending a class defined in a library you link in (and for which codegen already happened) is certainly possible…<br>
</div></blockquote><div><br></div><div>It's not possible without LTO, which is crazy. Depending on an advanced optimiser to generate the most basic code is a clear mistake.</div><div><br></div><div>I think we just need the ability to state 'final:' and mark explicit 'virtual's, the problem is mitigated without breaking the language. I can live with a policy where everyone is instructed to write code that way.</div>
</div>