Item 22: Declare data members private(Effective C++)
时间:2011-03-27 来源:Ray Z
Declare data members private. It gives clients syntactically uniform access to data, affords fine-grained access control, allows invariants to be enforced, and offers class authors implementation flexibility.
protected is no more encapsulated than public.
protected is no more encapsulated than public.
相关阅读 更多 +