Target typed new expressions for D?

12345swordy alexanderheistermann at gmail.com
Fri Apr 30 19:05:12 UTC 2021


On Friday, 30 April 2021 at 16:20:13 UTC, sighoya wrote:
> Relates to the following:
>
> https://devblogs.microsoft.com/dotnet/welcome-to-c-9-0/#target-typed-new-expressions
>
> What do you think about?
>
> I like it more than `auto` inference. You have an explicit 
> invariant, and the constructor takes the invariant into account 
> for value construction.
>
> I think, however, that using `new` in D isn't possible anymore, 
> maybe some different keyword.
>
> Is this at all possible with templates now or did we suffer 
> from missing return type deduction?

It is a nice feature to use in c#. However there are big fish to 
fry regarding improvements to d.

-Alex


More information about the Digitalmars-d mailing list