static array in templated struct/class

ddos via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Tue Aug 5 12:19:35 PDT 2014


On Tuesday, 5 August 2014 at 19:13:31 UTC, Marc Schütz wrote:
> On Tuesday, 5 August 2014 at 18:36:35 UTC, ddos wrote:
>> alias Vec4f = TVector!(float,4);
>> alias Vec3f = TVector!(float,3);
>>
>> class TVector(T,int n)
>> {
>> 	T[n] val;
>> ...
>>
>> TVector as class does work as expected, as a struct i get the 
>> following errors, but why?
>>
>> struct Vector.TVector!(float, 4).TVector no size yet for 
>> forward reference
>> struct Vector.TVector!(float, 3).TVector no size yet for 
>> forward reference
>
> Can you show the complete code? I cannot reproduce this with 
> either latest DMD git, DMD 2.065, or LDC 0.13.0:
>
>     alias Vec4f = TVector!(float,4);
>     alias Vec3f = TVector!(float,3);
>
>     struct TVector(T,int n)
>     {
>         T[n] val;
>     }
>
>     Vec3f a;
>     Vec4f b;

http://pastebin.com/34sbffSa
thx for your help :) !
i use DMD 2.065 btw


More information about the Digitalmars-d-learn mailing list