summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorTyge Løvset <[email protected]>2020-08-16 14:44:28 +0200
committerTyge Løvset <[email protected]>2020-08-16 14:45:45 +0200
commit3a94b2e55fb24796ff68d28a59609eb2a456e899 (patch)
tree1cc1eb58a035415d1f80ed303769d5197b9d195e
parent22bd152dacca69de6e1c44a0ecb897d4ea2b5abd (diff)
parentc1c58da3ce1a5c6fe47d08e7d9d825cd4956cc86 (diff)
downloadSTC-modified-3a94b2e55fb24796ff68d28a59609eb2a456e899.tar.gz
STC-modified-3a94b2e55fb24796ff68d28a59609eb2a456e899.zip
Merge branch 'master' of https://github.com/tylo-work/C99Containers into master
-rw-r--r--README.md4
1 files changed, 2 insertions, 2 deletions
diff --git a/README.md b/README.md
index 8118684f..0af43303 100644
--- a/README.md
+++ b/README.md
@@ -139,11 +139,11 @@ An alternative is to use *char* * as key type, but then you must manage allcoate
Note that this customization is also available for **cvec**, but only affects the *find()* function currently. See *declare_cvec_str()*.
Finally, cmap mimics c++17 unordered_map::try_emplace() and avoids cstr memory leak if key already exists in this example:
-`
+```
declare_cmap_str(ss, cstr_t, cstr_destroy); // cstr_t -> cstr_t
...
cmap_try_emplace(&map, ss, "already here", cstr_make("won't be called then")); // special: tag 'ss' is a parameter here.
-`
+```
You may want to look at **examples/advanced.c**, it demonstrates how to use a custom struct as a hash map key, using the optional parameters to declare_cmap().
Example usages