Merge pull request #4154 from yglukhov/sizeof-doc

Added limitations note to sizeof. Closes #4153.
This commit is contained in:
Andreas Rumpf
2016-05-15 10:57:42 +02:00

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