More type-flexible arrays?
via Digitalmars-d-learn
digitalmars-d-learn at puremagic.com
Sun Jun 14 03:48:37 PDT 2015
On Sunday, 14 June 2015 at 06:12:30 UTC, Ozan wrote:
> Hallo!
>
> Is it possible to create arrays which has more then one type,
> f. ex. array[0] = 1; array[1] = "z"; array[2] = new clazz(),
> ....
>
> I tried "Variant", but it slow down heavily my app.
>
> Greetings,
> Ozan
You can try Algebraic instead (also in std.variant). It's
possible that it's faster, but OTOH, you need to specify the list
of types it can accept.
More information about the Digitalmars-d-learn
mailing list