Added limitations note to sizeof. Closes #4153.
This commit is contained in:
parent
299989f3aa
commit
5a49c51b4c
1 changed files with 3 additions and 0 deletions
|
|
@ -588,6 +588,9 @@ proc sizeof*[T](x: T): int {.magic: "SizeOf", noSideEffect.}
|
|||
## that one never needs to know ``x``'s size. As a special semantic rule,
|
||||
## ``x`` may also be a type identifier (``sizeof(int)`` is valid).
|
||||
##
|
||||
## Limitations: If used within nim VM context ``sizeof`` will only work
|
||||
## for simple types.
|
||||
##
|
||||
## .. code-block:: nim
|
||||
## sizeof('A') #=> 1
|
||||
## sizeof(2) #=> 8
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue