moverload_asgn2.nim 196 B

1234567891011
  1. type
  2. Concrete* = object
  3. a*, b*: string
  4. rc*: int # refcount
  5. proc `=`(d: var Concrete; src: Concrete) =
  6. shallowCopy(d.a, src.a)
  7. shallowCopy(d.b, src.b)
  8. dec d.rc
  9. d.rc = src.rc + 1