title: Fast hash function for `std::vector`
body: <p>I implemented this solution for getting an hash value from <code>vector&lt;T&gt;</code>:</p>
  
  <pre><code>namespace std
  {
      template&lt;typename T&gt;
      struct hash&lt;vector&lt;T&gt;&gt;
      {
          typedef vector&lt;T&gt; argument_type;
          typedef std::size_t result_type;
          result_type operator()(argument_type const&amp; in) const
          {
              size_t size = in.size();
              size_t seed = 0;
              for (size_t i = 0; i &lt; size; i++)
                  //Combine the hash of the current vector with the hashes of the previous ones
                  hash_combine(seed, in[i]);
              return seed;
          }
      };
  }
  
  //using boost::hash_combine
  template &lt;class T&gt;
  inline void hash_combine(std::size_t&amp; seed, T const&amp; v)
  {
      seed ^= std::hash&lt;T&gt;()(v) + 0x9e3779b9 + (seed &lt;&lt; 6) + (seed &gt;&gt; 2);
  }
  </code></pre>
  
  <p>But this solution doesn't scale at all: with a <code>vector&lt;double&gt;</code> of 10 millions elements it's gonna take more than 2.5 s (according to VS).</p>
  
  <p>Does exists a fast hash function for this scenario? </p>
  
  <p>Notice that creating an hash value from the vector reference is not a feasible solution, since the related <code>unordred_map</code> will be used in different runs and in addition two <code>vector&lt;double&gt;</code> with the same content but different addresses will be mapped differently (undesired behavior for this application).</p>