Final by default?

Andrei Alexandrescu SeeWebsiteForEmail at erdani.org
Thu Mar 13 13:00:33 PDT 2014


On 3/13/14, 12:49 PM, Dmitry Olshansky wrote:
> 13-Mar-2014 23:40, Andrei Alexandrescu пишет:
>> On 3/13/14, 12:38 PM, Dmitry Olshansky wrote:
>>> Not the same as `final:` inside - the above just means you can't inherit
>>> from A. Funnily enough any new methods in A would still be virtual even
>>> if nothing can inherit from it!
>>
>> Looks like we could improve on this. Is there an enhancement request
>> available?
>>
>
> None that I know of.

Just played with some code a bit, turns out at least gdc inlines calls 
for final classes appropriately: http://goo.gl/oV8EYu. What would be a 
reliable way to detect that a vtable entry is generated?

> P.S. I have a strong distaste to the way OOP is currently designed in D
> anyway. No, I don't propose to change it.

I take it that overridable by default is part of it. What other things 
are not to your liking?


Andrei



More information about the Digitalmars-d mailing list