Use parameter pack to that the default hash_value is the worst match
This commit is contained in:
parent
5b6b04ef9c
commit
0a2f2c2247
|
@ -11,11 +11,11 @@ namespace Kakoune
|
||||||
|
|
||||||
size_t hash_data(const char* data, size_t len);
|
size_t hash_data(const char* data, size_t len);
|
||||||
|
|
||||||
template<typename Type>
|
template<typename... Type>
|
||||||
typename std::enable_if<not std::is_enum<Type>::value, size_t>::type
|
size_t hash_value(const Type&... val)
|
||||||
hash_value(const Type& val)
|
|
||||||
{
|
{
|
||||||
return std::hash<Type>()(val);
|
static_assert(sizeof...(Type) == 1, "");
|
||||||
|
return std::hash<Type...>()(val...);
|
||||||
}
|
}
|
||||||
|
|
||||||
template<typename Type>
|
template<typename Type>
|
||||||
|
|
Loading…
Reference in New Issue
Block a user