How to have an unordered_map where the value type is the class it's in?
<p>This code:</p>

<pre><code>class Foo {
    std::unordered_map&lt;std::string, Foo&gt; x;
};
</code></pre>

<p>gives me an error:</p>

<pre><code>/usr/include/c++/4.7/bits/stl_pair.h:94:11:
  error: 'std::pair&lt;_T1, _T2&gt;::second' has incomplete type
foo.cpp:4:7: error: forward declaration of 'class Foo'
</code></pre>

<p>However, this code compiles just fine:</p>

<pre><code>class Foo {
    std::vector&lt;Foo&gt; x;
};
</code></pre>

<p>Is this a library/compiler bug?</p>
