Is it valid to "hide" a base class virtual function by making it pure virtual in derived classes? : <p>Consider the example:</p>

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

class A {
    public:
    virtual void f();
};

void A::f()
{
    std::cout &lt;&lt; "f() from A\n";
}

class B: public A {
    public:
    virtual void f() = 0;
};

class C: public B {
    public:
    void f();
};

void C::f()
{
    std::cout &lt;&lt; "f() from C\n";
}

int main()
{
    C o;
    o.f();
}
</code></pre>

<p><code>A::f()</code> implementation is "hidden" from class C, which provides its own implementation for <code>f()</code> - effectively making <code>A::f()</code> more or less pointless. I see little value in such class hierarchy design, but my question whether this is a valid C++ or just "works" (such as undefined behaviours)?</p>
