How to prevent derived class from making a private/protected virtual function public?
问题 There are good reasons for constructing the base class interface with all virtual functions as private or protected (see this). But then how does one prevent the derived classes (which may be in the hands of external clients) from making the private virtual function as public? In Virtually Yours, the authors talk about this problem, but no solution is discussed. Edit : From your answers and as I previously thought, it seems there is no way to prevent this. But since in this situation, it is