Don't allow to reassign, but content is editable

Kagamin spam at here.lot
Wed Apr 7 12:54:17 UTC 2021


struct A
{
     private int[] a;
     this(int[] b){a=b;}
     int[] c(){ return a; }
     @disable void opAssign();
}
struct B
{
     A a;
     this(int){ a=new int[5]; }
     int[] b(){ return a.c; }
     void f(){ a=new int[5]; }
}


More information about the Digitalmars-d-learn mailing list