What are the rules for virtual function lookup?
<pre><code>#include &lt;iostream&gt;
class base
{
    public:
    virtual void print (int a)
    {   
        std::cout &lt;&lt; "a: " &lt;&lt; a &lt;&lt; " base\n";
    }   
    virtual void print (int a, int b)
    {   
        std::cout &lt;&lt; "base\n";
    }   
};

class derived : public base
{
    public:
    virtual void print (double d)
    {   
        std::cout &lt;&lt; "derived\n";
    }   
};

int main ()
{
    int i = 10; 
    double d = 10000.0;
    base *b = new derived (); 
    b-&gt;print (i, i); 
    b-&gt;print (d);

    return 0;
}
</code></pre>

<p>The output of this function is:</p>

<pre><code>base
a: 10000 base
</code></pre>

<p>Why <code>b-&gt;print (d)</code> don't invoke the derived class implementation and performs static cast on <code>'d'</code> to provide a match with base class implementation ? What rule is applied here during virtual function lookup ?</p>
