Why define a subclass as a friend of its own parent class?
<p>I was looking through some C++ code written by a (now departed) coworker quite a long time ago, and found an odd class definition I'm trying to decipher.</p>

<pre><code>class BaseClass
{
    friend SubClass1;
    friend SubClass2;
}

class SubClass1 : public BaseClass
{
    ...
}

class SubClass2 : public BaseClass
{
    ...
}
</code></pre>

<p>Is there a benefit to designing a class hierarchy this way? If you want access to private methods of BaseClass from the subclasses wouldn't you just move them to protected instead of private? I feel there is an idiom I'm missing here.</p>
