Three Unlikely Successful Features of D

James Miller james at aatch.net
Tue Mar 20 15:58:10 PDT 2012


On 21 March 2012 11:49, Andrej Mitrovic <andrej.mitrovich at gmail.com> wrote:
> Now a real one: auto type inference. Could you possibly imagine what
> the type name should be on the left-hand side?
>
> ? x = retro(stride(chain([1, 2], [3, 4]), 2));
>
> Who knows. auto is great for these higher-level types.

Also when dealing with complex parameterized types, so when I have a
function that gives me the type

foo!(bar!(int, 5), baz!string) I don't have to know that, I can just
use `auto` instead.

--
James Miller


More information about the Digitalmars-d mailing list