How do you copy a const struct to a mutable?

Malte Skarupke malteskarupke at web.de
Wed Oct 31 20:01:05 PDT 2012


I want to get this to compile:

void main()
{
     struct A
     {
         this(int x) { this.x = x; }
         int x;
     }
     const(A) a = A(5);
     A b = a;
}

It should clearly be legal to create a non-const copy of the 
struct. What am I missing in order to do this?

Cheers,

Malte


More information about the Digitalmars-d mailing list