title: Access overloaded base class method with same name as derived method
body: <p>I'm attempting to call a method from a base class with the same name as a method in the derived class. Here's a simplified example:</p>
  
  <pre><code>#include &lt;iostream&gt;
  
  using namespace std;
  
  class Base
  {
  public:
      void print() {
          cout &lt;&lt; "Printing from base" &lt;&lt; endl;
      }
  
      void print(int num) {
          cout &lt;&lt; "Printing number from base: " &lt;&lt; num &lt;&lt; endl;
      }
  };
  
  class Derived : public Base
  {
      using Base::print;
  
  public:
      void print() {
          cout &lt;&lt; "Printing from derived" &lt;&lt; endl;
      }
  };
  
  
  int main()
  {
      Derived x;
  
      x.print();
      x.Base::print(1);
  
      //x.print(1); // Gives a compilation error
  
      return 0;
  }
  </code></pre>
  
  <p>Basically, I'd like to be able to call x.print(1) and get "Printing number from base: 1", that is, automatically call the method which matches the signature, even though it resides in the base class.</p>
  
  <p>Without the <code>using Base::print;</code>, I get <code>error: no matching function for call to 'Derived::print(int)'</code>, which makes perfect sense due to name hiding.</p>
  
  <p>Thus, I added that line, but now the error is <code>error: 'void Base::print(int)' is inaccessible</code></p>
  
  <p>Why is this the case? I use public inheritance, so I would have thought it was readily available?</p>
  
  <p>As demonstrated in the example, it works fine to manually call <code>x.Base::print(1);</code>, but I would like to do it more transparently. Then of course I can re-implement a wrapper to the function in the derived class, but that does not seem very elegant either.</p>
  
  <p>I apologize if this has been covered in an earlier question, I read a bunch of them and found a lot of similar cases, but nothing that helped me.</p>