This commit is contained in:
Andreas Rumpf 2016-01-30 17:03:23 +01:00
commit 1a9c8b44d3

View file

@ -151,7 +151,7 @@ proc `addr`*[T](x: var T): ptr T {.magic: "Addr", noSideEffect.} =
## echo cast[ptr char](p)[] # b ## echo cast[ptr char](p)[] # b
discard discard
proc unsafeAddr*[T](x: var T): ptr T {.magic: "Addr", noSideEffect.} = proc unsafeAddr*[T](x: T): ptr T {.magic: "Addr", noSideEffect.} =
## Builtin 'addr' operator for taking the address of a memory location. ## Builtin 'addr' operator for taking the address of a memory location.
## This works even for ``let`` variables or parameters for better interop ## This works even for ``let`` variables or parameters for better interop
## with C and so it is considered even more unsafe than the ordinary ``addr``. ## with C and so it is considered even more unsafe than the ordinary ``addr``.