diff options
author | Andreas Rumpf <rumpf_a@web.de> | 2015-07-09 19:48:49 +0200 |
---|---|---|
committer | Andreas Rumpf <rumpf_a@web.de> | 2015-07-09 19:48:49 +0200 |
commit | ae0cb7e0147b8f3c676e26fa301cb2ee660c56ad (patch) | |
tree | 53c478533b4b54d9453ef954782b260088d5f616 | |
parent | 7aa227ba79b6b363ab4b75a2b16ad1d60f51e49a (diff) | |
parent | 66ce99d0180331374c13026b7cc3734095821cdb (diff) | |
download | Nim-ae0cb7e0147b8f3c676e26fa301cb2ee660c56ad.tar.gz |
Merge pull request #3085 from apense/patch-10
Update sets documentation. Fixes #3058
-rw-r--r-- | doc/sets_fragment.txt | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/doc/sets_fragment.txt b/doc/sets_fragment.txt index 84b13e672..15f0962ef 100644 --- a/doc/sets_fragment.txt +++ b/doc/sets_fragment.txt @@ -1,6 +1,16 @@ The set type models the mathematical notion of a set. The set's -basetype can only be an ordinal type. The reason is that sets are implemented -as high performance bit vectors. +basetype can only be an ordinal type of a certain size, namely: + * ``int8``-``int16`` + * ``uint8``/``byte``-``uint16`` + * ``char`` + * ``enum`` +or equivalent. The reason is that sets are implemented as high +performance bit vectors. Attempting to declare a set with a larger type will +result in an error: + +.. code-block:: nim + + var s: set[int64] # Error: set is too large Sets can be constructed via the set constructor: ``{}`` is the empty set. The empty set is type compatible with any concrete set type. The constructor |