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

Reply via email to