Newbie: copy, assignment of class instances

Larry Luther larry.luther at dolby.com
Thu May 27 12:14:15 PDT 2010


"bearophile" <bearophileHUGS at lycos.com> wrote in message 
news:ht42el$6c9$1 at digitalmars.com...
  ...
| There is no standard way to do this. In general you don't need to copy 
classes or their contents, because they are on the heap and managed by the 
GC.

I'm nonplussed.

Could you expand on why D class instances don't need to copy their contents 
and
instances of D structs do?  While migrating C++ code to D I've had to 
convert
"struct"s to "class"es because of the need for inheritance.  Why would the 
need
to copy an instance's contents to another instance disappear?

Larry 




More information about the Digitalmars-d-learn mailing list