using this instead of typeof(this)

Ben Davis entheh at cantab.net
Tue Feb 26 14:39:39 PST 2013


On 26/02/2013 18:41, bearophile wrote:
> Kenji Hara:
>
>> auto return is a little different with others. To infer return type,
>> the method body is aggressively analyzed in compilation.
>
> So that usage of "auto" sounds like something to avoid if you want D
> compiler to compile quickly a lot of code.

I suspect it doesn't matter actually. The semantic analysis of the 
function body is going to have to happen anyway. It all depends on 
whether the compiler does an extra pass which it throws away the work of 
- which seems fairly unlikely to me (having written a couple of Java 
type resolvers I could have done without having to write xD).


More information about the Digitalmars-d-learn mailing list