Private implementation for public interface method
<p>I have encountered a piece of code with method being exposed via public interface while the implementation is private. I'm not sure what should be the expected behavior. Simplified example:</p>

<pre><code>#include &lt;iostream&gt;

class Interface
{
public:
    virtual ~Interface() {}
    virtual void myIfMethod() = 0;
};

class Derived : public Interface
{
private:
    void myIfMethod(){std::cout &lt;&lt; "private method invoked via public interface" &lt;&lt; std::endl;}
};

int main()
{
    Interface* myObj = new Derived;
    myObj-&gt;myIfMethod();
    delete myObj;
    return 0;
}
</code></pre>

<p>This sample compiles and executes without a warning: <a href="http://ideone.com/1Ouwk4" rel="nofollow">http://ideone.com/1Ouwk4</a></p>

<p>Is this a correct and well-defined behavior? And if so, why?</p>

<p>Note, the question <strong>isn't about private interface method with public implementation</strong> (there are multiple such questions on SO) but <strong>the other way around</strong>.</p>