title: Why is std::hash a struct instead of a function?
body: <p>Standard library implements std::hash as a template struct that is specialized for different types. It is used like this:</p>
  
  <pre><code>#include &lt;iostream&gt;
  #include &lt;functional&gt;
  
  int main()
  {
      std::hash&lt;int&gt; hasher;
      std::cout &lt;&lt; hasher(1337) &lt;&lt; std::endl;
  
      return 0;
  }
  </code></pre>
  
  <p>My question is what is the reasoning behind this design choice. Why it isn't implemented as a template function and used like this:</p>
  
  <pre><code>#include &lt;iostream&gt;
  #include &lt;functional&gt;
  
  int main()
  {
      std::cout &lt;&lt; std::hash&lt;int&gt;(1337) &lt;&lt; std::endl;
  
      return 0;
  }
  </code></pre>