overloading of '=' works
This commit is contained in:
parent
78f371c03a
commit
05e39cf6ad
9 changed files with 147 additions and 6 deletions
10
tests/assign/moverload_asgn2.nim
Normal file
10
tests/assign/moverload_asgn2.nim
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
type
|
||||
Concrete* = object
|
||||
a*, b*: string
|
||||
rc*: int # refcount
|
||||
|
||||
proc `=`(d: var Concrete; src: Concrete) =
|
||||
shallowCopy(d.a, src.a)
|
||||
shallowCopy(d.b, src.b)
|
||||
dec d.rc
|
||||
d.rc = src.rc + 1
|
||||
Loading…
Add table
Add a link
Reference in a new issue