title: error: hash function must be invocable with an argument of key type
body: <p>I'm using a custom hash function with <code>unordered_map</code>, but I get this error:</p>
  
  <pre class="lang-none prettyprint-override"><code>error: static assertion failed: hash function must be invocable with an argument of key type
  </code></pre>
  
  <p>It works fine when I use the default hash function of <code>unordered_multimap</code>. </p>
  
  <p>My code:</p>
  
  <pre><code>#include&lt;vector&gt;
  #include&lt;string&gt;
  #include&lt;unordered_map&gt;
  
  using namespace std;
  
  class Hasher {
  public:
      size_t operator() (string const&amp; key) const {
          size_t hash = 0;
          for(size_t i = 0; i &lt; key.size(); i++) {
              hash += key[i] % 7;
          }
          return hash;
      }
  };
  
  int main(int argc, char const *argv[]) {
  
      unordered_multimap&lt;int, int, Hasher, equal_to&lt;int&gt;&gt; hashmap;
  
      hashmap.insert(make_pair(1, 11));
      hashmap.insert(make_pair(1, 21));
      hashmap.insert(make_pair(2, 12));
      hashmap.insert(make_pair(3, 13));
  
      auto range = hashmap.equal_range(1); 
  
      return 0;
  }
  </code></pre>