Implicit conversion from const to mutable

Balagopal Komarath via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Thu Aug 17 12:24:00 PDT 2017


Is it possible to make structs containing slices support implicit 
conversion from const to mutable? I tried adding a postblit that 
dupes the member 'a'. That didn't work.

struct A
{
     int[] a;
}

void main()
{
     static assert (is(const(A) : A)); // fails
}


More information about the Digitalmars-d-learn mailing list