this(this) must be cheap and O(1)

Trass3r un at known.com
Sat Sep 24 08:14:56 PDT 2011


> > Isn't an expensive-to-copy type supposed to be a class anyway?
> 
> Well not always - see BigInt.

True.

> A nothrow function may allocate memory, but allocating inside this(this) 
> would be a faux pas.

So I can't .dup inside this(this)?
Even the example in the docs does so:
http://www.d-programming-language.org/struct.html#StructPostblit


More information about the Digitalmars-d mailing list