How about "auto" parameters?
Mehrdad
wfunction at hotmail.com
Thu Jun 2 20:16:39 PDT 2011
I just thought of something:
The patterns
auto foo1(T)(T arg) { /+ ... +/ }
auto foo2(T...)(T args) { /+ ... +/ }
are very common.
Why not just supporting the syntax
auto foo1(auto arg) { /+ ... +/ }
auto foo2(auto args...) { /+ ... +/ }
to make things easier?
People can still say typeof(arg), typeof(args[0]), etc., just like
before, but it's a lot easier (and cooler!) to have a code with all
inferred types, rather than explicitly typed templates.
Any ideas?
More information about the Digitalmars-d
mailing list