I know you can do this with inheritance, but you’re meant to use inheritance for except for ‘is a’ circumstances. I also know there are friends, but they allow access to private members as well.
Is there any way of doing this (Allowing Access to Protected Members of Class and not Private Members)?
To reword the question, I have class 1 and class 2. I want class two to have access to class 1’s protected and public members, but not it’s private members. How would I do this?
It’s not elegant, but this might work for you: