mirror of
https://github.com/nim-lang/Nim.git
synced 2026-06-04 02:44:44 +00:00
Add more info for {.bycopy.} (#18815)
* Add more info for {.bycopy.}
See confusion here: https://github.com/nim-lang/Nim/issues/18807
I hope this will help people googling to find this.
* Update doc/manual.rst
Co-authored-by: Andreas Rumpf <rumpf_a@web.de>
This commit is contained in:
@@ -7912,6 +7912,7 @@ instructs the compiler to pass the type by value to procs:
|
||||
Vector {.bycopy.} = object
|
||||
x, y, z: float
|
||||
|
||||
The Nim compiler automatically determines whether a parameter is passed by value or by reference based on the parameter type's size. If a parameter must be passed by value or by reference, (such as when interfacing with a C library) use the bycopy or byref pragmas.
|
||||
|
||||
Byref pragma
|
||||
------------
|
||||
|
||||
Reference in New Issue
Block a user