diff --git a/data_tamer_cpp/include/data_tamer/types.hpp b/data_tamer_cpp/include/data_tamer/types.hpp index ffdcc0f..7da8dde 100644 --- a/data_tamer_cpp/include/data_tamer/types.hpp +++ b/data_tamer_cpp/include/data_tamer/types.hpp @@ -148,3 +148,18 @@ std::string ToStr(const Schema& schema); [[nodiscard]] uint64_t AddFieldToHash(const TypeField& field, uint64_t hash); } // namespace DataTamer + + +template <> +struct std::hash +{ + std::size_t operator()( const DataTamer::RegistrationID& id ) const + { + // Compute individual hash values for first, second and third + // http://stackoverflow.com/a/1646913/126995 + std::size_t res = 17; + res = res * 31 + hash()( id.first_index ); + res = res * 31 + hash()( id.fields_count ); + return res; + } +};