Inheritance: Function that returns self type?
<p>Let's say I have two classes:</p>

<pre><code>class A
{
    public:
    A* Hello()
    {
        return this;
    }
}

class B:public class A
{
    public:
    B* World()
    {
        return this;
    }
}
</code></pre>

<p>And let's say I have an instance of <code>B</code> class like so:</p>

<pre><code>B test;
</code></pre>

<p>If I call <code>test.World()-&gt;Hello()</code> that would work fine.
But <code>test.Hello()-&gt;World()</code> would not work since <code>Hello()</code> returns <code>A</code> type.</p>

<p>How could I make <code>Hello()</code> return the type of <code>B</code>? I don't want to use a <code>virtual</code> function since we have over 20 different classes inheriting <code>A</code>.</p>
