Suppose a class: Library
And we have a group of derived class from the base class LibraryCustomer, such as: Kid, Parent, Student, etc
In the class of Library, there are a group of (tons of) private members variables. Since there are tons of private members in the class of Library, I do not want to use getter and setter which are tedious. Plus the LibraryCustomer derived classes will often refer to those members. Getter and Setter are not convenient.
In order for those LibraryCustomers to access those private member in Library, I need to claim those LibraryCustomers as friend classes in Library.
But since the derived classes keep growing, I do not want to add them one by one in the class Library.
Add the base class LibraryCustomer as friend in Library seems not to work. So what is another better way?
[Update] I want to access tons of private member variables in the class of Library. Since there are many, so I do not want to use getter and setter. I hope the derived classes from LibraryCustomer can freely access those private member variables in the class of Library.