520: Highlights
- If you want to limit access to a member variable or member function to
member functions defined in the same class,
then place that member variable or member function in the private part
of the class definition.
- If you want to limit access to a member variable or member function to
member functions defined in the same class or in subclasses
of that class,
then place that member variable or member function in the protected part
of the class definition.
- If you do not wish to limit access to a member variable or member function,
then place that member variable or member function in the public part
of the class definition.
- If you wish to prevent member variable reassignment,
and you wish to reference those member variables,
then place the member variables in the private part of the class definition,
and define member variable readers in the public or protected part of the
class definition.