What is the design reasons for Not considering base class overloaded

bearophile bearophileHUGS at lycos.com
Wed May 25 02:43:46 PDT 2011


Matthew Ong:

> 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 pure theory, little more than advertisement. Also because D supports separate compilation, Walter doesn't even look interested in doing this :-)


> alias A.foo foo;  // ### Why the extra steps is needed for the compiler 
> to 'know' overloaded functions from base classes?

Others have already answered. I also suggest you to compile your code using the -w switch when possible.

Bye,
bearophile


More information about the Digitalmars-d-learn mailing list