Is it possible to store different subclasses in one array?

Manfred Nowak svv1999 at
Tue Apr 14 22:02:46 UTC 2020

On Monday, 13 April 2020 at 05:54:52 UTC, evilrat wrote:
>     if (auto weapon = cast(Weapon) gi)
>         weapon.Attack();

Does the parlor (currently illegal in Dlang)

       if (Weapon w := gi)

look nicer or even (currently legal):

       if (Weapon w ._= gi)

More information about the Digitalmars-d-learn mailing list