Added limitations note to sizeof. Closes #4153.

This commit is contained in:
Yuriy Glukhov
2016-05-13 20:09:14 +03:00
parent 299989f3aa
commit 5a49c51b4c

View File

@@ -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