C++ Compile Error - "no type named 'function' in namespace std"
<p>I'm working on an assignment for my C++ programming class which involves implementing a hash map. My instructor has given us a header file that we are required to use with our hash map class. The provided header file contains the line:</p>

<pre><code>typedef std::function&lt;unsigned int(const std::string&amp;)&gt; HashFunction;
</code></pre>

<p>From my (limited) understanding of C++, this would define the type HashFunction as a std::function. However, when I compile the code, I get the errors:</p>

<pre><code>./HashMap.h:46:15: error: no type named 'function' in namespace 'std'
        typedef std::function&lt;unsigned int(const std::string&amp;)&gt; HashFunction;
                ~~~~~^
./HashMap.h:46:23: error: expected member name or ';' after declaration specifiers
        typedef std::function&lt;unsigned int(const std::string&amp;)&gt; HashFunction;
        ~~~~~~~~~~~~~~~~~~~~~^
</code></pre>

<p>The HashMap.h file has</p>

<pre><code>#include &lt;functional&gt;
</code></pre>

<p>at the top, if it matters.</p>

<p>Does anyone know why I'm getting these errors?</p>
