1 class C 2 { 3 this (int a, int b, string c) 4 { 5 this.a = a; 6 this.b = b; 7 this.c = c; 8 } 9 int a; int b; string c; 10 } 11 void f(C c) 12 { 13 c.resetAllMembers(); 14 } 15 auto c = new C(1, 2, "3"); 16 assert(c.a == 1); 17 assert(c.b == 2); 18 assert(c.c == "3"); 19 f(c); 20 assert(c.a == 0); 21 assert(c.b == 0); 22 assert(c.c == null);
http://forum.dlang.org/post/ckitmpguywfitgadfpkv@forum.dlang.org http://forum.dlang.org/post/fbs8b5$5bu$1@digitalmars.com
Reset all members in aggregate instance c.