#include <chrono>
#include <iostream>
#include <vector>


template <class T>
inline void hash_combine(std::size_t& seed, T const& v)
{
    seed ^= std::hash<T>()(v) + 0x9e3779b9 + (seed << 6) + (seed >> 2);
}

namespace std
{
	template<typename T>
	struct hash { };
    template<typename T>
    struct hash<std::vector<T>>
    {
        typedef std::vector<T> argument_type;
        typedef std::size_t result_type;
        result_type operator()(argument_type const& in) const
        {
            size_t size = in.size();
            result_type seed = 0;
            for (size_t i = 0; i < size; i++)
                //Combine the hash of the current vector with the hashes of the previous ones
                hash_combine(seed, in[i]);
            return seed;
        }
    };
}

int main() {
	std::vector<double> arr(1000*1000*10);
	auto start = std::chrono::high_resolution_clock::now();
	size_t hash = std::hash<std::vector<double>>()(arr);
	auto stop = std::chrono::high_resolution_clock::now();
	std::cout << "hash of " << arr.size() << " doubles took ";
	std::cout << std::chrono::duration_cast<std::chrono::microseconds>(stop - start).count();
	std::cout << " us and resulted in hash: " << hash << std::endl;
	return 0;
}