does D already have too many language features ?

Paul paultjeadriaanse at gmail.com
Fri Jan 29 22:33:37 UTC 2021


On Friday, 29 January 2021 at 05:09:14 UTC, Basile B. wrote:
>   void foo(T)(T t){}
>   foo({a:10, b:8}) // huh ...
>
> Impossible.
>
>   void foo(T : S)(T t){}
>   foo({a:10, b:8}) // okay but painful...

It looks like
> foo((Type){ bla bla bla })
In C right? Which seems like a simple syntax to me.
(Or is that actually a cast?)

On the note of casts, as I forgot to add this earlier.
I'm slightly confused as to why dlang chose to use 'cast(Type)' 
instead of '(Type)', but even more confused why dlang has no 
'reinterp(Type)' (for as far as i know), instead requiring to use 
'*cast(Type*)&var' (iirc).


More information about the Digitalmars-d mailing list