diff options
Diffstat (limited to 'include/framework/RecordInterface.h')
| -rw-r--r-- | include/framework/RecordInterface.h | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/include/framework/RecordInterface.h b/include/framework/RecordInterface.h index 6936a8b..ab4c6f9 100644 --- a/include/framework/RecordInterface.h +++ b/include/framework/RecordInterface.h @@ -14,6 +14,7 @@ #include <cmath> #include "util/base.h" +#include "util/hash.h" namespace de { @@ -117,4 +118,12 @@ struct Point{ return sqrt(pow(x - other.x, 2) + pow(y - other.y, 2)); } }; + +template<RecordInterface R> +struct RecordHash { + size_t operator()(R const &rec) const { + return hash_bytes((char *) &rec, sizeof(R)); + } +}; + } |