Is it possible to store different generic types in ex. somekind of container such as an array, hashtable etc.

Let's say we got

class Foo(T) {
    ...
}

Would it be possible to store something like

Foo[] foos; // Where Foo of course should allow any generic version of Foo

Ex.

Foo!int and Foo!string should both be able to be stored inside the array.

If so how would one construct an array like that or is there some other container that may be able to do it?


  • I... Is it possible to store different generic types? via Digitalmars-d-learn
    • ... Is it possible to store different generic types? via Digitalmars-d-learn
      • ... Charles Hixson via Digitalmars-d-learn
    • ... Ali Çehreli via Digitalmars-d-learn
    • ... Erik van Velzen via Digitalmars-d-learn

Reply via email to