Thank you for the clarifications. I'm trying to do a shallow copy. After reading Simen & bearophile, I would add a "copy" member function:
class A {
int x, y;
void copy (in A a) {
x = a.x;
y = a.y;
}
}
class B : A {
int z;
void copy (in B b) {
super.copy( b);
z = b.z;
}
}
B foo = new B,
B bar = new B;
Q: Do I copy the member variables contributed by class A
from "foo" to "bar", this way: "(cast(A) bar).copy( foo);"?
Or maybe "bar.A.copy( foo);"?
Larry
