question on [Issue 7853]

Dan dbdavidson at yahoo.com
Sun Nov 4 12:49:07 PST 2012


This bug has no comments. The original says: "The fix is obvious:
redefine postblit as this(const this); but it isn't always obvious
when looking at hundreds of lines of code...."

Is this accepted/correct? In the following if I include the 
this(const
this) postblit it does not get called. It makes me question if 
the fix
is obvious?

Thanks
Dan


-------
import std.stdio;

struct S {
   static if(false) {
     this (const this) { writeln("const postblit");}
   } else {
     this (this) { writeln("non-const postblit");}
   }
}
void main () {
   const(S) s;
   S s2 = s;
}


More information about the Digitalmars-d-learn mailing list