virtual-by-default rant

David Nadlinger see at klickverbot.at
Sun Mar 18 02:00:29 PDT 2012


On Sunday, 18 March 2012 at 03:27:40 UTC, bearophile wrote:
> F i L:
>> "All non-static non-private non-template member functions are 
>> virtual. This may sound inefficient, but since the D compiler 
>> knows all of the class hierarchy when generating code, all 
>> functions that are not overridden can be optimized to be 
>> non-virtual."
>
> This is so much theoretical that I think this should be removed 
> from the D docs. And to be put back when one DMD compiler is 
> able to do this. Otherwise it's just false advertising :-)

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…

David


More information about the Digitalmars-d mailing list