Making sure the method declaration is inherited
<p>How can I protect from accidental definition of non-inherited method where inherited definition is intended. I am told there is trick to express it, but nobody can recall it. </p>

<p>Explanation. I have tree of classes: 'Base' &lt;- 'C' &lt;- 'D', below. Base defines pure virtual function. The function gets redefined in C then in D. But the function has very long argument list.</p>

<p>Somewhere along chain of derivation, there is subtle error in the agrglist which makes D:: non-inherited. Program hapily compiles. And the wrong method is called in the run-time.<br>
Is there trick to cause compilation error when method is non-inherited.</p>

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

class Base {
public:
    virtual void VeryLongFunctionName(int VeryLongArgumentList) = 0;
};
class C : public Base {
public:
    void VeryLongFunctionName(int VeryLongArgumentList) {
        std::cout &lt;&lt; "C::\n";
    }
};
class D : public C {
public:
    void VeryLongFunctionNane(int VeryLongArgumentList) { // typo is intentional. It's the point of the question.
        std::cout &lt;&lt; "D::\n";
    }
};

int main() {
    Base *p = new D;
    p-&gt;VeryLongFunctionName(0);
            // the intention is to print D::. But it prints C::.
            // How can we make compiler catch it.       
    return 0;
}
</code></pre>
