Sturcts with constructor (dmd1.x)
Strtr
strtr at spam.com
Tue Jan 12 01:35:34 PST 2010
bearophile Wrote:
> grauzone:
> > > Struct constructors are probably the D2 feature I miss more in D1 :-)
> >
> > Why?
>
> During optimization phases I sometimes want to convert classes into structs, and then I want to allocate some of those struct instances on the heap and others on the stack. A struct constructor allows me to change as little as possible to the code that uses those new structs.
How much of an overhead is a call to a struct instance compared to a call to a object?
More information about the Digitalmars-d
mailing list