Both references could be `nil`.
proc deepCopy[T](dst: var ref T; src: ref T) =
if unlikely(src == nil):
dst = nil
else:
if dst == nil:
dst.new()
deepCopy(dst[], src[])
Run
- what's with deepCopy? mode80
- what's with deepCopy? Araq
- what's with deepCopy? sls1005
- what's with deepCopy? Hlaaftana
- what's with deepCopy? sls1005
