title: Overriding overloaded methods hides some of the overloads
body: <p>Suppose I have the following classes:  </p>
  
  <pre><code>class Base
  {
  public:
      virtual void myMethod()
      {
  
      }
  
      virtual void myMethod(int x)
      {
  
      }
  };
  
  class Derived : public Base
  {
  };
  </code></pre>
  
  <p>In this situation the following code compiles just fine.</p>
  
  <pre><code>int main(void)
  {
      Derived obj;
      obj.myMethod();
  
      return (0);
  }
  </code></pre>
  
  <p>The problem arises when I try to override one of <code>myMethod</code>s like below.</p>
  
  <pre><code>class Derived : public Base
  {
  public:
      virtual void myMethod(int x)
      {
  
      }
  };
  </code></pre>
  
  <p>Now the code won't compile and gives the error:</p>
  
  <blockquote>
    <p>error C2660: 'Derived::myMethod' : function does not take 0 arguments</p>
  </blockquote>
  
  <p>I have overridden one of the overloaded functions and apparently this has hidden the other one from <code>Derived</code> class. To get rid of the error I have to override all the overloads. This is against my expectation and doesn't seem rational to me. Why does this code behave this way?  </p>
  
  <p>The problem can be reproduced <a href="http://cpp.sh/5ovc" rel="nofollow">here</a>.</p>