2015-01-07 20:29:31 +01:00
|
|
|
#ifndef vector_hh_INCLUDED
|
|
|
|
#define vector_hh_INCLUDED
|
|
|
|
|
|
|
|
#include "memory.hh"
|
2019-12-01 01:09:01 +01:00
|
|
|
#include "hash.hh"
|
2015-01-07 20:29:31 +01:00
|
|
|
|
|
|
|
#include <vector>
|
|
|
|
|
|
|
|
namespace Kakoune
|
|
|
|
{
|
|
|
|
|
2017-05-26 08:59:18 +02:00
|
|
|
template<typename T, MemoryDomain domain = memory_domain(Meta::Type<T>{})>
|
2015-01-07 20:29:31 +01:00
|
|
|
using Vector = std::vector<T, Allocator<T, domain>>;
|
|
|
|
|
2019-12-01 01:09:01 +01:00
|
|
|
template<typename T, MemoryDomain domain>
|
|
|
|
size_t hash_value(const Vector<T, domain>& vector)
|
|
|
|
{
|
|
|
|
size_t hash = 0x1235678;
|
|
|
|
for (auto&& elem : vector)
|
|
|
|
hash = combine_hash(hash, hash_value(elem));
|
|
|
|
return hash;
|
|
|
|
}
|
|
|
|
|
2015-01-07 20:29:31 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
#endif // vector_hh_INCLUDED
|