title: Unable to use method of base class
body: <blockquote>
    <p><strong>Possible Duplicate:</strong><br>
    <a href="https://stackoverflow.com/questions/3202234/overloaded-functions-are-hidden-in-derived-class">overloaded functions are hidden in derived class</a>  </p>
  </blockquote>
  
  
  
  <p>It seems that I cannot directly use methods from a base class in a derived class if they are overloaded in both the base class and the derived class in C++. The following code produces the error <code>no matching function for call to ‘Derived::getTwo()’</code>.</p>
  
  <pre><code>class Base {
  public:
      int getTwo() {
          return 2;
      }
      int getTwo(int, int) {
          return 2;
      }
  };
  
  class Derived : public Base {
  public:
      int getValue() {
          // no matching function for call to ‘Derived::getTwo()’
          return getTwo();
      }
      int getTwo(int) {
          return 2;
      }
  };
  </code></pre>
  
  <p>If I change <code>return getTwo();</code> to <code>return ((Base*) this)-&gt;getTwo()</code>, it works, but that looks ugly to me. How can I fix this?</p>
  
  <p>P.S. I use g++ 4.7 with option std=gnu++c11, if that matters.</p>