title: C++: request for member is ambiguous
body: <pre><code>#include &lt;iostream&gt;
  using namespace std;
  class c1{
          public:
                  void f(){std::cout&lt;&lt;"In f1\n";}
  };
  class c2{
          public:
                  void f(){std::cout&lt;&lt;"In f2\n";}
  };
  
  template &lt;typename T&gt;
  class c:public c1, c2 {
      T* pT;
  public:
      T* operator-&gt;() { return pT; }
  };
  
  int main()
  {
  c&lt;c1&gt;* cMain;
  cMain-&gt;f();
  return 0;
  }
  </code></pre>
  
  <p>Error:</p>
  
  <pre><code>g++ cache.cc
  cache.cc: In function ‘int main()’:
  cache.cc:22:8: error: request for member ‘f’ is ambiguous
   cMain-&gt;f();
          ^
  cache.cc:9:8: note: candidates are: void c2::f()
     void f(){std::cout&lt;&lt;"In f2\n";}
          ^
  cache.cc:5:8: note:                 void c1::f()
     void f(){std::cout&lt;&lt;"In f1\n";}
  </code></pre>
  
  <p>why is it not accessing the function f of c1 as specified in the template? is my template usage wrong? How can i make it point to the required class using template.?</p>