I thought that the final keyword in Java completely prevents derivation for the class, rather than allowing derivation while preventing overloading of particular virtual functions.
That can be done as follows;
Code:
class BaseLocker
{
private:
friend class Base;
BaseLocker() {};
BaseLocker(const BaseLocker &) {};
~BaseLocker();
};
class Base: virtual public BaseLocker
{
public:
Base();
};
class Derived: public Base
{
};
Derived derived; // error as BaseLocker must be constructed first, and it's constructors are private