|
Euphoria
|
Helper macros for specializing the std::hash. More...
Classes | |
| struct | eu::core::HashCombiner |
| A utility for combining hash values of multiple objects into a single hash value. More... | |
Macros | |
| #define | HASH_DEF_BEGIN(TYPE) |
| Begins the definition of a specialization of std::hash for the given TYPE. | |
| #define | HASH_DEF(NAME) .combine(x.NAME) |
| Adds the hash of a member variable to the hash combination. | |
| #define | HASH_DEF_END() |
| Ends the definition of the std::hash specialization. | |
Helper macros for specializing the std::hash.
This group provides a util HashCombiner to simplify the creation of hash functions for user-defined types (using std::hash) and macros for specialization of std::hash for custom types.
Example usage:
| #define HASH_DEF | ( | NAME | ) | .combine(x.NAME) |
#include <libs/core/src/eu/core/hash.h>
Adds the hash of a member variable to the hash combination.
\hideinlinesource
This macro should be used within a HASH_DEF_BEGIN and HASH_DEF_END block to combine the hash of a specific member variable of the type.
| NAME | The name of the member variable to include in the hash. |
| #define HASH_DEF_BEGIN | ( | TYPE | ) |
#include <libs/core/src/eu/core/hash.h>
Begins the definition of a specialization of std::hash for the given TYPE.
Should be closed by the HASH_DEF_END macro
| TYPE | The user-defined type for which the hash specialization is being created. \hideinlinesource |
| #define HASH_DEF_END | ( | ) |
#include <libs/core/src/eu/core/hash.h>
Ends the definition of the std::hash specialization.
This macro should be used to close the hash function definition started with HASH_DEF_BEGIN. It returns the final combined hash value.
\hideinlinesource