How can I make a function only possible to be called by certain subclasses in c++?
<p>I have a class <code>base</code> with a private array (I cannot make it protected).
I have getters and setters set for objects in the array.
<code>base</code> has a subclass <code>sub1</code> and <code>sub1</code> has a subclass <code>sub2</code>.</p>

<p>Is there a way to make <code>sub1</code> only able to access some of <code>base</code>'s getter's and setter's and make <code>sub2</code> able to access other getters and setters?</p>

<p>Something with virtual methods perhaps?</p>
