resetAllMembers

Reset all members in aggregate instance c.

void
resetAllMembers
(
T
)
(
T c
)
if (
is(T == class)
)

Examples

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);

See Also

Meta