default implemented opAssign purity

Ali Çehreli acehreli at yahoo.com
Sun Dec 2 11:12:45 PST 2012


On 12/02/2012 07:50 AM, Dan wrote:
 > On Sunday, 2 December 2012 at 14:13:34 UTC, Maxim Fomin wrote:

 >> Are you looking for this http://dpaste.dzfl.pl/7ee27db2 ?
 >
 > I did not know you could call __postblit - that's cool.

I did not know either. :)

I was going to ask "Is __postblit a part of the language spec" but then 
I found TypeInfo.postblit:

   http://dlang.org/phobos/object.html#postblit

I hoped the following might work:

         typeid(this).postblit(&this);

But no, it is not pure:

   Error: pure function 'opAssign' cannot call impure function 'postblit'

Ali



More information about the Digitalmars-d-learn mailing list