Why value of pointer to this is different in global function, member function and constructor? //--------------------------------------------------------------------------------------------------- module test; class Foo{ this(){ writefln("ctor 0x%08X", cast(dword)&this); }
void func(){ writefln("func 0x%08X", cast(dword)&this); } } import std.stdio; void main(){ Foo foo = new Foo; writefln("main 0x%08X", cast(dword)&foo); foo.func(); } //--------------------------------------------------------------------------------------------------- sample output: ctor 0x0012FEC8 main 0x0012FEE8 func 0x0012FEB8