Array of templated classes

tsalm tsalm at free.fr
Tue Aug 19 07:40:40 PDT 2008


>>  Does somebody know or have a way to do this :
>>  /* --- BEGIN ---*/
>> class MyClass(T) {T myData;}
>>  void main()
>> {
>>   MyClass[] myArray;
>> }
>>  /* ---  END  --- */
>>  Thanks in advance for your help.

>
>
> Not sure what version of D your using but D2.0 has a variant type..
> http://www.digitalmars.com/d/2.0/phobos/std_variant.html
>
> and so does tango
> http://dsource.org/projects/tango/docs/current/tango.core.Variant.html

I'm actually using D1.0, but the tango's support is all right. Thanks.
Forgive me for this question, but what is the difference with using  
"void*" ?


More information about the Digitalmars-d-learn mailing list