summaryrefslogtreecommitdiffhomepage
path: root/docs/cmap_api.md
diff options
context:
space:
mode:
authorTyge Løvset <[email protected]>2022-11-06 12:57:47 +0100
committerTyge Løvset <[email protected]>2022-11-06 12:57:47 +0100
commitb69006463de7b3f11d974bdddb5782282482f515 (patch)
tree6f182dc201164fead2b5b1a094e6e8a2b43dc0a1 /docs/cmap_api.md
parentc230e4cd830de22fad2f7085d968d905dadc7418 (diff)
downloadSTC-modified-b69006463de7b3f11d974bdddb5782282482f515.tar.gz
STC-modified-b69006463de7b3f11d974bdddb5782282482f515.zip
Improved documentation of template parameters for all containers.
Diffstat (limited to 'docs/cmap_api.md')
-rw-r--r--docs/cmap_api.md12
1 files changed, 7 insertions, 5 deletions
diff --git a/docs/cmap_api.md b/docs/cmap_api.md
index 802bfa00..48aa7e0d 100644
--- a/docs/cmap_api.md
+++ b/docs/cmap_api.md
@@ -17,15 +17,15 @@ See the c++ class [std::unordered_map](https://en.cppreference.com/w/cpp/contain
## Header file and declaration
```c
+#define i_type // container type name (default: cmap_{i_key})
#define i_key // hash key: REQUIRED
#define i_val // map value: REQUIRED
#define i_hash // hash func i_keyraw*: REQUIRED IF i_keyraw is non-pod type
#define i_eq // equality comparison two i_keyraw*: REQUIRED IF i_keyraw is a
- // non-integral type. Three-way i_cmp may be specified alternatively.
-#define i_size // size_t or uint32_t(default). If defined, table expand 2x (else 1.5x)
+ // non-integral type. Three-way i_cmp may alternatively be specified.
#define i_keydrop // destroy key func - defaults to empty destruct
-#define i_keyclone // REQUIRED IF i_valdrop defined
+#define i_keyclone // REQUIRED IF i_keydrop defined
#define i_keyraw // convertion "raw" type - defaults to i_key
#define i_keyfrom // convertion func i_keyraw => i_key
#define i_keyto // convertion func i_key* => i_keyraw
@@ -36,8 +36,10 @@ See the c++ class [std::unordered_map](https://en.cppreference.com/w/cpp/contain
#define i_valfrom // convertion func i_valraw => i_val
#define i_valto // convertion func i_val* => i_valraw
-#define i_tag // typename tag. defaults to i_key
-#define i_type // full typename of the container
+#define i_size // default: uint32_t. If defined, table expand 2x (else 1.5x)
+#define i_hash_functor // advanced, see examples/cpque.c for similar usage.
+#define i_eq_functor // advanced, see examples/cpque.c for similar usage.
+#define i_tag // alternative typename: cmap_{i_tag}. i_tag defaults to i_val
#include <stc/cmap.h>
```
`X` should be replaced by the value of `i_tag` in all of the following documentation.