I've been trying to test out the hash table from the Bitsquid foundations library in tandem with the Bitsquid blog post on Entity Component Systems but the library changed since the blog post was written and I'm getting a type conversion error.
foundation::Hash < Entity > map;
struct Instance { int i; };
Instance MakeInstance(int index) { Instance inst = { index }; return inst; }
Instance Lookup(Entity e) { return MakeInstance(hash::get(map, e.id, 0)); }
Error: Cannot convert argument 1 from 'const Entity' to 'unsigned int'
Or sometimes I get: template parameter 'T' is ambiguous
If I change < Entity > to int, for example, the error goes away. When I tried a regular unordered map, it said the STL doesn't know how to hash to an Entity, so I'm guessing it's the same issue but the error is presenting differently in this library.
However, knowing the problem isn't the same thing as knowing how to fix it. I've tried casting to uint64_t and int but have had no success. What do I need to do here?
PS: Yes, I've seen the unit test.