Feature request - type inference for new

Nick Sabalausky a at a.a
Mon Jun 16 13:49:13 PDT 2008


"Jason House" <jason.james.house at gmail.com> wrote in message 
news:g36f76$m7u$1 at digitalmars.com...
> I'd prefer using the auto keyword as a replacement for the missing type... 
> ie. the following candidate syntaxes:
>  funky = new auto;
>  funky = new auto();
>  c = new auto(a,b);
>  c = new auto(b,a);
>

I'd have to agree with this.  "c = new typeof(c);" is an improvement over 
repeating the entire type, but still isn't totally DRY. Before you posted I 
was kinda thinking something like "c = new typeof(_lvalue);", but "c = new 
auto();" is much cleaner. 





More information about the Digitalmars-d mailing list