title: C++ multiple inheritance - same method names - can I somehow remove one of them?
body: <p>I have this structures in C++11</p>
  
  <pre><code>struct A {
     int idA;   
     void setId(int i) { idA = i;}
     int getId() { return idA;}
  
     virtual void foo() = 0;
  };
  
  struct B {
     int idB;   
     void setId(int i) { idB = i;}
     int getId() { return idB;}
  
     virtual void foo2() = 0;
  };
  
  struct AB : public A, public B
  {
     void foo() override {}
     void foo2() override {}
  };
  </code></pre>
  
  <p>Now in main I can call it like this:</p>
  
  <pre><code>AB * ab = new AB();
  ab-&gt;B::setId(10);
  </code></pre>
  
  <p>but I dont really like it. </p>
  
  <p>Is there any other solution?  Methods <code>setId/getId</code> from <code>struct A</code> are not needed in <code>AB</code>. I just did the inheritance, because I need <code>foo()</code> and other stuff from <code>A</code>, but all other methods are unique.</p>