Simulate covariant return type behavior
<pre><code>class Ancestor{};

class Descendant : public Ancestor{};

class Base
{
public:
   Ancestor foo(void);
};

class Derived : public Base
{
public:
// Do not redefine foo as : Descendant foo(void);
};
</code></pre>

<p>I want to write Deriveds foo in a way that when it is called for a Derived object it will return Descendant.I know that this can be done easily with covariant return type usage. But what if i could not use this feature. How can i simulate this feature in the code above?</p>
