another compiler bug?

Aarti_pl aarti at interia.pl
Thu Jan 10 04:54:30 PST 2008


Christopher Wright pisze:
>> I managed to overcome bug in DMD with below:
>>
>> void func(T)() {
>>     static TYPE res;
>>     res = new T;
>>         return &res;
>> }
>>
>> although it will cause memory leaks for every type for which the 
>> function is instantiated. So I consider bug in DMD as quite serious...
> 
> Does that work? With more than one instance created? I would think you'd 
> only ever be able to access the most recent one.

Yes. I used something similar in C++.

BR
Marcin Kuszczak
(aarti_pl)


More information about the Digitalmars-d-learn mailing list