Multiple inheritance: 2Classes1Method
<p>I've just tried this piece of code:</p>

<pre><code>struct FaceOfPast
{
    virtual void Smile() = 0;
};

struct FaceOfFuture
{
    virtual void Smile() = 0;
};

struct Janus : public FaceOfPast, public FaceOfFuture
{
    virtual void Smile() {printf(":) ");}
};
</code></pre>

<p>...</p>

<pre><code>void main()
{
    Janus* j = new Janus();
    FaceOfFuture* future = j;
    FaceOfPast* past = j;

    future-&gt;Smile();
    past-&gt;Smile();

    delete j;
}
</code></pre>

<p>It works as intended (outputs two smiley faces), but I don't think it should even compile, redeclaration of <code>Smile()</code> in <code>Janus</code> being ambiguous.</p>

<p>How (and why) does it work?</p>
