Is there a way to prevent a method from being overridden in subclasses?
When you can use the final specifier for virtual methods (introduced with C++11), you can do it. Let me quote my favorite doc site: When used in a virtual function declaration, final specifies that the function may not be overridden by derived classes. Adapted to your example that’d be like: class Base { public: virtual … Read more