Small fix to destructors example
This commit is contained in:
parent
a0b8a3d920
commit
c7e4e96aaf
1 changed files with 1 additions and 1 deletions
|
|
@ -37,7 +37,7 @@ written as:
|
|||
|
||||
proc `=destroy`*[T](x: var myseq[T]) =
|
||||
if x.data != nil:
|
||||
for i in 0..<x.len: `=destroy`(x[i])
|
||||
for i in 0..<x.len: `=destroy`(x.data[i])
|
||||
dealloc(x.data)
|
||||
|
||||
proc `=copy`*[T](a: var myseq[T]; b: myseq[T]) =
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue