1
1
mirror of https://github.com/mawww/kakoune.git synced 2024-12-01 16:32:54 +03:00

Use parameter pack to that the default hash_value is the worst match

This commit is contained in:
Maxime Coste 2015-02-07 20:15:22 +00:00
parent 5b6b04ef9c
commit 0a2f2c2247

View File

@ -11,11 +11,11 @@ namespace Kakoune
size_t hash_data(const char* data, size_t len);
template<typename Type>
typename std::enable_if<not std::is_enum<Type>::value, size_t>::type
hash_value(const Type& val)
template<typename... Type>
size_t hash_value(const Type&... val)
{
return std::hash<Type>()(val);
static_assert(sizeof...(Type) == 1, "");
return std::hash<Type...>()(val...);
}
template<typename Type>