Struct copy, how?

nobody somebody at somewhere.com
Sat Jan 3 21:40:36 PST 2009


"bearophile" <bearophileHUGS at lycos.com> wrote in message 
news:gjn7s1$1vk4$1 at digitalmars.com...
> nobody:
> BCS:
>> > However this still has a few problems: 1, if claw contains a reference
>> > type you will now have 2 Claws that refer to the same thing and 2, you
>> > need to maintain opAssign to be sure that it copies all members.
>> >
>> > One way to attack both of these would be to use a template to build a
>> > generic deep copy that uses compile time refection to copy all the
>> > members, duping arrays of PODS, copying basic types and recursively 
>> > deep
>> > copying reference types and arrays of them.
>
>> Guess I'll do that.
>> Thanks for the help!
>
> If you create a generic deep copy I may find it useful.
>
> Bye,
> bearophile

Heh, unfortunately I wouldn't even know where to begin in order to make 
something like that. 




More information about the Digitalmars-d-learn mailing list