Working mechanism of private inheritance of a class having private constructor
<p>case 1:</p>

<pre><code>class ObjectCount {
private:
    ObjectCount(){}
};

class Employee : private ObjectCount {};
</code></pre>

<p>case 2:</p>

<pre><code>class ObjectCount {
public:
    ObjectCount(){}
};

class Employee : private ObjectCount {};
</code></pre>

<p>In case1: ObjectCount constructor is private and inheritance is private . It gives compiler error</p>

<p>In case2: ObjectCount constructor is public  and inheritance is private . this code is ok. </p>

<p>Can anyone explain how is it happening?</p>
