diff options
| author | Tyge Løvset <[email protected]> | 2021-01-19 12:50:02 +0100 |
|---|---|---|
| committer | Tyge Løvset <[email protected]> | 2021-01-19 12:50:02 +0100 |
| commit | 60132bb5653cf5bd5cf5c0c331bf827456097af5 (patch) | |
| tree | d9c3212a9214ab7fd6549a48505dc270e6595e0a /docs | |
| parent | 7fa5cd3a4092991268276259fa07fda2bb12cfc1 (diff) | |
| download | STC-modified-60132bb5653cf5bd5cf5c0c331bf827456097af5.tar.gz STC-modified-60132bb5653cf5bd5cf5c0c331bf827456097af5.zip | |
Changed template args sequence in cmap.
Diffstat (limited to 'docs')
| -rw-r--r-- | docs/cmap_api.md | 14 | ||||
| -rw-r--r-- | docs/csmap_api.md | 2 |
2 files changed, 7 insertions, 9 deletions
diff --git a/docs/cmap_api.md b/docs/cmap_api.md index cbfa3d1c..c0fb81d2 100644 --- a/docs/cmap_api.md +++ b/docs/cmap_api.md @@ -8,10 +8,10 @@ See [std::unordered_map](https://en.cppreference.com/w/cpp/container/unordered_m ## Declaration ```c -#define using_cmap(X, Key, Mapped, mappedDestroy=c_default_del, - mappedClone=c_default_clone, - keyEqualsRaw=c_default_equals, +#define using_cmap(X, Key, Mapped, keyEqualsRaw=c_default_equals, keyHashRaw=c_default_hash, + mappedDestroy=c_default_del, + mappedClone=c_default_clone, keyDestroy=c_default_del, keyFromRaw=c_default_clone, keyToRaw=c_default_to_raw, @@ -202,9 +202,7 @@ Demonstrate cmap with plain-old-data key type Vec3i and int as mapped type: cmap typedef struct { int x, y, z; } Vec3i; -using_cmap(v3, Vec3i, int, c_default_del, // mapped: empty int destroy func - c_default_clone, // mapped: clone int by "memcpy" - c_mem_equals, // key: compare Vec3i bit-by-bit +using_cmap(v3, Vec3i, int, c_mem_equals, // key: compare Vec3i bit-by-bit c_default_hash32); // key: hash Vec3i in 32-bits word-by-word. int main() @@ -303,8 +301,8 @@ static inline VikingRaw viking_toRaw(Viking* vk) { // With this in place, we use the full using_cmap() macro to define {Viking -> int} hash map type: -using_cmap(vk, Viking, int, c_default_del, c_default_clone, - vikingraw_equals, vikingraw_hash, +using_cmap(vk, Viking, int, vikingraw_equals, vikingraw_hash, + c_default_del, c_default_clone, // mapped: int => use default. viking_del, viking_fromRaw, viking_toRaw, VikingRaw); int main() diff --git a/docs/csmap_api.md b/docs/csmap_api.md index 907c379a..f4cfcf48 100644 --- a/docs/csmap_api.md +++ b/docs/csmap_api.md @@ -25,7 +25,7 @@ See [std::map](https://en.cppreference.com/w/cpp/container/map) for a similar c+ RawKey=Key) #define using_csmap_str() ``` -The macro `using_csmap()` can be instantiated with 3, 5, 6, 8, or 10 arguments in the global scope. +The macro `using_csmap()` can be instantiated with 3, 4, 6, 8, or 10 arguments in the global scope. Default values are given above for args not specified. `X` is a type tag name and will affect the names of all csmap types and methods. E.g. declaring `using_csmap(my, int);`, `X` should be replaced by `my` in all of the following documentation. |
