summaryrefslogtreecommitdiffhomepage
path: root/examples
diff options
context:
space:
mode:
authorTyge Løvset <[email protected]>2022-05-12 15:29:15 +0200
committerTyge Løvset <[email protected]>2022-05-12 15:29:15 +0200
commit7b6fb49407abdd41c2bc1fdb8c84aaabcc3295de (patch)
tree01165be591bb08f362bfefd49bccec9548ff2302 /examples
parente2fad76fa778dc6bc041e2163615f230ae069f6b (diff)
downloadSTC-modified-7b6fb49407abdd41c2bc1fdb8c84aaabcc3295de.tar.gz
STC-modified-7b6fb49407abdd41c2bc1fdb8c84aaabcc3295de.zip
i_keyfrom/i_valfrom no longer used with i_key_bind/i_val_bind. Is considered optional for enabling emplace.
Diffstat (limited to 'examples')
-rw-r--r--examples/vikings.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/examples/vikings.c b/examples/vikings.c
index bd4d379f..41f5eb5b 100644
--- a/examples/vikings.c
+++ b/examples/vikings.c
@@ -37,14 +37,14 @@ static inline RViking Viking_toraw(const Viking* vp) {
// With this in place, we define the Viking => int hash map type:
#define i_type Vikings
#define i_key_bind Viking // key type
-#define i_val int // mapped type
#define i_keyraw RViking // lookup type
+#define i_keyfrom Viking_from // convert from lookup type (enables emplace)
#define i_hash(rp) c_strhash(rp->name) ^ c_strhash(rp->country)
+#define i_val int // mapped type
// i_key_bind auto-binds these functions (unless they are defined by i_...):
// i_cmp => RViking_cmp
// i_hash => RViking_hash
// i_keyclone => Viking_clone
-// i_keyfrom => Viking_from // because i_keyraw is defined
// i_keyto => Viking_toraw // because i_keyraw is defined
// i_keydrop => Viking_drop
#include <stc/cmap.h>