DavidLeeds / hashmap

Templated type-safe hashmap implementation in C using open addressing and linear probing for collision resolution.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

A way to use a pointer as key? without compiler warnings

FoxieFlakey opened this issue · comments

A way to use a pointer as key? without compiler warnings
/* Arbitrary key type */
struct key { ... };
struct value { ... }

HASHMAP(struct key, struct value) map;

/* Use the map, passing in `struct key *` as the key, and `struct value *` as the value */
/* Arbitrary key type */
struct key { ... };
struct value { ... }

HASHMAP(struct key, struct value) map;

/* Use the map, passing in `struct key *` as the key, and `struct value *` as the value */

wait so i dont pass it like struct key*
ah, that where my mistake is