문제

I have a base class Base, a somewhat more specialized class SpecializedBase derived from Base, and subclasses of the latter such as Derived.

I implement a virtual function in SpecialisedBase which is pure virtual in Base. How to be sure that this function is not overloaded in Derived?

도움이 되었습니까?

해결책

yes, if you can use C++11, you can write your class like

    struct derived {
        virtual void f() final;
    };
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top