Usage
copy y
copy!(x, y)
Signatures
copy: % % copy!: (%, %) %
Parameter | Type | Description |
---|---|---|
x,y | % | Element of the type |
Returns
copy(y) returns a copy of y, while copy!(x, y) returns a copy of y, where the storage used by x is allowed to be destroyed or reused, so x is lost after this call.
Remarks
Use copy before making in-place operations on a parameter. The call copy!(x, y) may cause x to be destroyed, so do not use it unless x has been locally allocated, and is guaranteed not to share space with other elements. Some functions are not necessarily copying their arguments and can thus create memory aliases.