Automatic variable declaration

0xEAB desisma at heidel.beer
Wed Aug 15 15:31:14 UTC 2018


On Wednesday, 15 August 2018 at 14:58:40 UTC, Everlast wrote:
> foo(x = 3);


C# 7 brought something similar for out params.
> int.tryParse("1234", out int myNum);

Based on this approach, I would argue, that a reasonable syntax 
would also contain the type, which leads to something like the 
following:
> foo(int x = 3);
> foo(auto x = 3);


But I don't think this feature is worth having in D.


More information about the Digitalmars-d mailing list