Make NumericId hashable

This commit is contained in:
Jean Pierre Cimalando 2020-09-11 17:16:31 +02:00
parent 9d26b5742e
commit 60eecba226

View file

@ -5,6 +5,8 @@
// If not, contact the sfizz maintainers at https://github.com/sfztools/sfizz
#pragma once
#include "../StringViewHelpers.h"
#include <functional>
/**
* @brief Numeric identifier
@ -50,3 +52,12 @@ struct NumericId {
private:
int number_ = -1;
};
namespace std {
template <class U> struct hash<NumericId<U>> {
size_t operator()(const NumericId<U> &id) const
{
return hashNumber(id.number());
}
};
}