The following program:

import std.stdio;

struct test {
  this(this){
    writefln("postblit");
  }

  int foo;

  this(int i){
    foo = i;
    writefln("%x",&foo);
  }

  ~this(){
    writefln("%x",&foo);
  }
}

void main(string[] args){
     test t = test(5);
}


Gives me this output on dmd 2.052:
18fe58
18fe54

Is this a bug in 2.052? (Doesn't happen with 2.053)
Why did the location of the struct change?
Is there any way to get informed about a struct beeing moved?
Is there a way to prevent it?
--
Kind Regards
Benjamin Thaut

Reply via email to