#include <evo/impl/container.h>
template<class T>
struct evo::CompareHash< T >
Hash object used with containers that hash items.
- This inherits an associated comparison type used with hash collisons
- Hashing is done with the SpookyHash V2 library (included with Evo):
- Non-POD types are compared by calling method the
T::hash()
, which should use DataHash to hash the actual data
- Template Parameters
-
◆ CompareBase
◆ Item
Item type (const removed)
◆ PassItem
Best type for passing Item, either const Item&
(by reference) or Item
(by value) for POD types.
◆ hash()
ulong hash |
( |
PassItem |
key, |
|
|
ulong |
seed = 0 |
|
) |
| const |
|
inline |
Hash function method.
- Parameters
-
key | Key to hash |
seed | Seed to start with, 0 for none, or can be from hashing another value |
- Returns
- Hash function result
◆ operator()()
Comparison method.
- Parameters
-
a | Item a to compare (left side) |
b | Item b to compare (right side) |
- Returns
- Comparison result: 0:equal, negative:(a < b), positive:(a > b)
Implements CompareBase< T >.
The documentation for this struct was generated from the following file: