title: Overriding the virtual functions with different return types raises error with private inheritance
body: <p>In the following code I got the following compilation errors:</p>
  
  <pre><code>1&gt;c:\users\mittamani\desktop\06-10\over_riding_test\over_riding_test\over_riding_test.cpp(33) : error C2555: '_D1::fun': overriding virtual function return type differs and is not covariant from 'Base2::fun'
  1&gt;        c:\users\mittamani\desktop\06-10\over_riding_test\over_riding_test\over_riding_test.cpp(28) : see declaration of 'Base2::fun'
  1&gt;        'Base1' : base class is not accessible
  1&gt;c:\users\mittamani\desktop\06-10\over_riding_test\over_riding_test\over_riding_test.cpp(37) : error C2555: '_D2::fun': overriding virtual function return type differs and is not covariant from 'Base2::fun'
  1&gt;        c:\users\mittamani\desktop\06-10\over_riding_test\over_riding_test\over_riding_test.cpp(28) : see declaration of 'Base2::fun'
  1&gt;        'Base1' : base class is not accessible
  1&gt;Build log was saved at "file://c:\Users\mittamani\Desktop\06-10\Over_riding_Test\Over_riding_Test\Debug\BuildLog.htm"
  1&gt;Over_riding_Test - 2 error(s), 0 warning(s)
  </code></pre>
  
  <p>Here is the code:</p>
  
  <pre><code>class Base1{
  public:
      Base1(){}
      virtual ~Base1(){}
  };
  
  class D1:Base1{
  
  };
  
  class D2:Base1{
  
  };
  
  class Base2{
  public:
      Base2(){}
      virtual ~Base2(){}
      virtual Base1 * fun() = 0;
  };
  
  class _D1:Base2{
  public:
      D1* fun(){}
  };
  
  class _D2:Base2{
  public:
      D2* fun(){}
  };
  </code></pre>
  
  <p>By the way, I am fresher to C++.. plz help..thanks in advance..</p>