virtual function override intended error
<p>In C++, I want to convert a class into another class, so I decided to create a template class, but I'm having a compilation error, here is the error,</p>

<pre><code>"MyFooClass.h", line 10: error (etoa:4997):
      function "IFoo::show(OtherClass &amp;)" is hidden by
      "MyFooClass::show" -- virtual function override
      intended?
  virtual std::auto_ptr&lt;ClNewClass&gt; show(ClOldClass  &amp;oc)
</code></pre>

<p>And here is my codes,</p>

<pre><code>//IFoo.h
class IFoo
{
    public:
        virtual ~IFoo(){}

    protected:
        virtual std::auto_ptr&lt;OtherClass&gt; show(OtherClass &amp;oc) = 0;
};

//CustomFoo.h
template&lt;typename oldClass, typename newClass&gt;
class CustomFoo : public IFoo
{
    public:
        virtual std::auto_ptr&lt;newClass&gt; show(oldClass &amp;oc)=0;

    protected:
        virtual std::auto_ptr&lt;OtherClass&gt; show(OtherClass &amp;oc)
        {
            std::auto_ptr&lt;OtherClass&gt; result(show(static_cast&lt;oldClass &amp;&gt;(oc)));
            return result;
        }
}; 

//MyFooClass.h
class MyFooClass : public CustomFoo&lt; ClOldClass, ClNewClass &gt;
{
    public:
        virtual std::auto_ptr&lt;ClNewClass&gt; show(ClOldClass &amp;oc)
        {
            std::auto_ptr&lt;ClNewClass&gt; cnv(new ClNewClass(oc.params));
            return cnv;
        }
};
</code></pre>

<p>Thanks.</p>
