class C { this (int a, int b, string c) { this.a = a; this.b = b; this.c = c; } int a; int b; string c; } void f(C c) { c.resetAllMembers(); } auto c = new C(1, 2, "3"); assert(c.a == 1); assert(c.b == 2); assert(c.c == "3"); f(c); assert(c.a == 0); assert(c.b == 0); 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.