mirror of
https://github.com/nim-lang/Nim.git
synced 2026-01-04 20:17:42 +00:00
Updated documentation of system.new. Ref #2699.
This commit is contained in:
@@ -178,7 +178,10 @@ proc new*[T](a: var ref T) {.magic: "New", noSideEffect.}
|
||||
|
||||
proc new*(T: typedesc): auto =
|
||||
## creates a new object of type ``T`` and returns a safe (traced)
|
||||
## reference to it as result value
|
||||
## reference to it as result value.
|
||||
##
|
||||
## When ``T`` is a ref type then the resulting type will be ``T``,
|
||||
## otherwise it will be ``ref T``.
|
||||
when (T is ref):
|
||||
var r: T
|
||||
else:
|
||||
|
||||
Reference in New Issue
Block a user