The OpenD Programming Language

xdestroy

Destroy structs and unions usnig __xdtor member if any. Do nothing for other types.

void
xdestroy
(
T
)
(
scope T[] ar
)

Examples

__gshared int d;
__gshared int c;
struct D { ~this() nothrow @nogc {d++;} }
extern(C++)
struct C { ~this() nothrow @nogc {c++;} }
C[2] carray;
D[2] darray;
carray.xdestroy;
darray.xdestroy;
assert(c == 2);
assert(d == 2);
c = 0;
d = 0;

Meta