Ray's playground

 

Item 22: Declare data members private(Effective C++)

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.

posted on 2011-03-27 20:56  Ray Z  阅读(181)  评论(0编辑  收藏  举报

导航