Is there any sense in marking a base class function as both virtual and final? [duplicate]
问题 This question already has answers here : What's the point of a final virtual function? (10 answers) Closed 2 years ago . In various explanations of C++11's final keyword, I'm seeing examples like this. class base { public: virtual void f() final; }; class derived : public base { public: virtual void f(); // Illegal due to base::f() declared final. }; Is this actually a useful use of final ? Why would you declare a virtual function in a base class (implying that it will be usefully