Casting by assigning to the right ...

Manfred Nowak svv1999 at hotmail.com
Tue Apr 14 21:02:24 UTC 2020


On Tuesday, 14 April 2020 at 14:50:29 UTC, Paul Backus wrote:
> You can avoid the need to look up the type by using `typeof`:
>
> i = cast(typeof(i)) s;

Yes. But it is unnecessary bloat of about 15 chars. I would 
rather annotate my knowledge of implicit-cast-assigning by 
writing:
   `i:= s;'



More information about the Digitalmars-d mailing list