xxxxxxxxxx
import std.stdio;
struct A
{
int x;
this(this)
{
writeln("calling postblit");
}
}
void main(string[] args)
{
A[] a = [A(1), A(2), A(3)];
A[] b = [A(2), A(3), A(4)];
writeln("Using slice >>>");
a[] = b[]; // ops.. opAssign is not called
writefln("Using slice <<<\n");
// what I was expecting this to be
writeln("Using for >>>");
for (size_t i = 0; i < a.length; ++i)
{
a[i] = b[i];
}
writeln("Using for <<<");
}