title: C++: error "... is not derived from type ..."
body: <pre><code>template&lt;typename T1, typename T2&gt;
  class Bimap {
  public:
      class Data;
      typedef Data* DataP;    
      typedef std::multimap&lt;T1, DataP&gt; T1Map;
      typedef std::multimap&lt;T2, DataP&gt; T2Map;
  
      class Data {
      private:
          Bimap&amp; bimap;
          T1Map::iterator it1;
          /*...*/
      };
  };
  </code></pre>
  
  <p>This gives me this compile error:</p>
  
  <p><code>error: type 'std::multimap&lt;T1, Bimap&lt;T1, T2&gt;::Data*, std::less&lt;_Key&gt;, std::allocator&lt;std::pair&lt;const T1, Bimap&lt;T1, T2&gt;::Data*&gt; &gt; &gt;' is not derived from type 'Bimap&lt;T1, T2&gt;::Data'</code></p>
  
  <p>What does that mean? What is the problem here?</p>