What's about virtual?

Jonathan M Davis jmdavisProg at gmx.com
Tue Sep 10 02:32:33 PDT 2013


On Tuesday, September 10, 2013 11:27:40 Simen Kjaeraas wrote:
> On Tue, 10 Sep 2013 02:28:24 +0200, Andrei Alexandrescu
> 
> <SeeWebsiteForEmail at erdani.org> wrote:
> > On 9/9/13 12:47 PM, H. S. Teoh wrote:
> >> On Mon, Sep 09, 2013 at 09:37:07PM +0200, Namespace wrote:
> >>> It's been a while since Manu convinced Walter and Andrei to
> >>> introduce a virtual Keyword and to change the default from virtual
> >>> methods to final methods.
> >>> Anything new? Anybody working on that? I would love to see that
> >>> soon.
> >> 
> >> This is going to break a lot of code. We'd need some kind of deprecation
> >> path. And even then, it may anger a lot of existing users.
> >> 
> >> 
> >> T
> > 
> > After I've seen a pretty cool demo of clang-modernize
> > (http://clang.llvm.org/extra/ModernizerUsage.html), I think the best way
> > to attack this and similar problems is to add a class hierarchy
> > analyzer: a command-line utility that is fed an entire project and adds
> > as many 'final' as possible without changing semantics.
> > 
> > Time has come to migrate such functionality to tools. We keep on telling
> > that "nobody uses the tools" but it seems experience contradicts that
> > belief.
> 
> So the catastrophe that is virtual by default will not be changed?

AFAIK, no official decision has ever been made. It seemed like Walter was 
convinced that it was worth it to make non-virtual the default, and some 
discussion went into how to do the transition, but I don't believe that Andrei 
has ever liked the idea, and Walter never said that it was definitively 
happening, much as he seemed to have been convinced that it should happen. And 
no one has implemented a pull request for it, so nothing has happened. So 
AFAIK, it could go either way at this point. We should probably create a DIP 
for it and discuss it. I've been meaning to do that but have been quite busy 
lately and haven't gotten around to it.

- Jonathan M Davis


More information about the Digitalmars-d-learn mailing list