Get address of object in constructor.

WebFreak001 via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Sun Mar 13 09:02:07 PDT 2016


On Sunday, 13 March 2016 at 15:43:02 UTC, MGW wrote:
> Cfoo foo = new Cfoo(); foo.saveThis(&foo);

However note that this is not the same as that function. 
cast(void*)this and &this are 2 different things. So if you want 
to do the same as saveThis just do void* thisAddr = cast(void*) 
&this; instead


More information about the Digitalmars-d-learn mailing list