<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META content="text/html; charset=iso-8859-1" http-equiv=Content-Type>
<META name=GENERATOR content="MSHTML 8.00.6001.18876">
<STYLE></STYLE>
</HEAD>
<BODY bgColor=#ffffff>
<DIV><FONT size=2 face="Courier New">Thank you for the
clarifications.</FONT></DIV>
<DIV><FONT size=2 face="Courier New">I'm trying to do a shallow
copy.</FONT></DIV>
<DIV><FONT size=2 face="Courier New"></FONT> </DIV>
<DIV><FONT size=2 face="Courier New">After reading <FONT size=3>Simen &
bearophile, I would add a "copy" member function:</FONT></FONT></DIV>
<DIV><FONT face="Courier New"></FONT> </DIV>
<DIV><FONT face="Courier New">
<DIV><FONT size=2 face="Courier New"> class A {</FONT></DIV>
<DIV><FONT size=2 face="Courier New"> int x, y;</FONT></DIV>
<DIV><FONT size=2></FONT> </DIV>
<DIV><FONT size=2> void copy (in A a) {</FONT></DIV>
<DIV><FONT size=2> x = a.x;</FONT></DIV>
<DIV><FONT size=2> y = a.y;</FONT></DIV>
<DIV><FONT size=2> }</FONT></DIV>
<DIV><FONT size=2 face="Courier New"> }</FONT></DIV>
<DIV><FONT size=2 face="Courier New"></FONT> </DIV>
<DIV><FONT size=2 face="Courier New"> class B : A {</FONT></DIV>
<DIV><FONT size=2 face="Courier New"> int z;</FONT></DIV>
<DIV><FONT size=2></FONT> </DIV>
<DIV><FONT size=2> void copy (in B b) {</FONT></DIV>
<DIV><FONT size=2> super.copy( b);</FONT></DIV>
<DIV><FONT size=2> z = b.z;</FONT></DIV>
<DIV><FONT size=2> }</FONT></DIV>
<DIV><FONT size=2 face="Courier New"> }</FONT></DIV>
<DIV><FONT size=2></FONT> </DIV>
<DIV>
<DIV><FONT size=2 face="Courier New"> B</FONT><FONT size=2
face="Courier New"> foo = new B,</FONT></DIV>
<DIV><FONT size=2 face="Courier New"> B bar = new
B;</FONT></DIV>
<DIV><FONT size=2></FONT> </DIV></DIV>
<DIV>
<DIV><FONT size=2 face="Courier New">Q: Do I copy the member
variables contributed by class A</FONT></DIV>
<DIV><FONT size=2 face="Courier New"> from "foo" to
"bar", this way: "(cast(A) bar).copy( foo);"?</FONT></DIV>
<DIV><FONT size=2> Or maybe "bar.A.copy( foo);"?</FONT></DIV>
<DIV><FONT size=2></FONT> </DIV>
<DIV><FONT size=2>Larry</FONT></DIV></DIV></FONT></DIV></BODY></HTML>