Virtual/Abstract members of a class
Virtual or Abstract members of a class cannot be private... Well just think, if you make them private why would you make them virtual or abstract anyways...:-)
PS: This tip is suffering from "Case of Monday" syndrome... :-)
2 comments:
This seems incorrect. as a matter of fact, good designers try to make virtual functions private. They cannot be called from the derived class, but they can be overridden.
The non-virtual interface (NVI) idiom says that there shouldn't be any virtual methods in a class' public interface. I don't strictly follow this idiom but there are times when adhering to it really pays off.
See also: http://www.gotw.ca/publications/mill18.htm
Post a Comment