title: About virtual function override in C++
body: <p>I'm a little confused about the following situations, are they correct ways for the overriding of function <code>copy</code> but not overloading, or all of them are right?</p>
  
  <pre><code>class Base{
  public:
      virtual Base* copy(Base* b){...}
  };
  
  class Derived:public Base{
  public:
      virtual Base* copy(Base* b){...}//I know this should work
   // but how about the followings?
      //virtual Base* copy(Derived* b){...}
      //virtual Derived* copy(Base* b){...}
      //virtual Derived* copy(Derived* b){...}
  };
  </code></pre>
  
  <p>BTW, does the change of access right make any difference? say, I write the Derived class like this:</p>
  
  <pre><code>class Derived:public Base{
  private://or protected:
      virtual Base* copy(Base* b){...}
      ...
  };
  </code></pre>