diff options
author | Yuriy Glukhov <yutiy.glukhov@gmail.com> | 2016-05-13 20:09:14 +0300 |
---|---|---|
committer | Yuriy Glukhov <yutiy.glukhov@gmail.com> | 2016-05-13 20:09:14 +0300 |
commit | 5a49c51b4cd902f172264e28a567be3783ac73be (patch) | |
tree | 955e2c9a5d21b8790c3be12dd3669a19a39557d9 /lib | |
parent | 299989f3aa72b4bb0558ce5dbe7043dc83a4d2a5 (diff) | |
download | Nim-5a49c51b4cd902f172264e28a567be3783ac73be.tar.gz |
Added limitations note to sizeof. Closes #4153.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/system.nim | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/system.nim b/lib/system.nim index f584f7590..cb98bcc5f 100644 --- a/lib/system.nim +++ b/lib/system.nim @@ -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 |