From 7b6fb49407abdd41c2bc1fdb8c84aaabcc3295de Mon Sep 17 00:00:00 2001 From: Tyge Løvset Date: Thu, 12 May 2022 15:29:15 +0200 Subject: i_keyfrom/i_valfrom no longer used with i_key_bind/i_val_bind. Is considered optional for enabling emplace. --- examples/vikings.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'examples') 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 -- cgit v1.2.3