title: C++ "overload virtual warning" when implementing interface
body: <p>Here is my example code:</p>
  
  <pre><code>class Interface {
      public:
          virtual void foo(const Interface &amp;interface) = 0;
  };
  
  class A : public Interface {
      public:
          void foo(const A &amp;a) {
                  // do something with another object of same type
          }
  };
  
  class B : public Interface {
      public:
          void foo(const B &amp;b) {
          }
  };
  </code></pre>
  
  <p>There is a warning:</p>
  
  <pre><code>warning: 'A::foo' hides overloaded virtual function
        [-Woverloaded-virtual]
              void foo(const A &amp;a) {
                   ^
  note: hidden overloaded virtual function 'Interface::foo'
        declared here: type mismatch at 1st parameter ('const Interface &amp;' vs
        'const A &amp;')
              virtual void foo(const Interface &amp;interface) = 0;
  </code></pre>
  
  <p>How to deal with the problem? Is adding <code>using Interface::foo;</code> in derived class the best solution? I think it's a common problem. Thanks a lot!</p>