Biggest problems w/ D - struct/class

BCS ao at pathlink.com
Fri Aug 10 15:50:33 PDT 2007


Reply to C. Dunn,

> 
> struct S{}
> class C{}
> version(fast){
> alias C Foo;
> }else{
> alias S* Foo;
> }
> The problem is that, since S lacks ctor/dtor, I have to rewrite my
> code substantially.
> 

For ctor you could use a static method to wrap the new for both cases. Not 
vary clean but the performance hit should be the same for both sides.

For dtor, no such luck. Then again I have yet to ever use a dtor in D.





More information about the Digitalmars-d mailing list