Postblit constructor
Eduard Staniloiu
edi33416 at gmail.com
Fri Mar 2 10:35:32 UTC 2018
On Wednesday, 28 February 2018 at 18:27:49 UTC, Jiyan wrote:
> On Wednesday, 28 February 2018 at 18:23:04 UTC, Jiyan wrote:
>> Hey,
>> i thought i had understood postblit, but in my Code the
>> following is happening (simplified):
>>
>> struct C
>> {
>> this(this){/*Do sth*/}
>> list!C;
>>
>> void opAssign(const C c)
>> {
>> "Postlbit from C called".writeln;
>> // Do sth
>> }
>> }
>
> Sry of course it is
>
> "Postlbit from C called".writeln; in this(this)
> and the c from opAssign should get constructed via postblit.
> Doesnt it?
I'm not sure I understood your question, so please let me know if
this clears things out or not.
The parameter of opAssign will be constructed through a postblit
call, but you need to explicitly assign what you want from the
parameter inside the instance of _this_ object.
More information about the Digitalmars-d-learn
mailing list