Is it perfectly legal to declare a pure virtual function twice (in two classes in an hierarchy)

c++, inheritance, pure-virtual

Solution

Yes this is legal because there are not the same functions at all. The `B::f()` function is an overriding of `A::f()`. The fact that `f()` is virtual in both cases is not entering into account.

Problem

The question's title is pretty clear. Here's what I mean by example: ``` class A { public: virtual void f() = 0; }; class B: public A { public: virtual void f() = 0; }; class C: public B { public: virtual void f() {} }; ```

Original source

Related problems