error C2248: 'std::basic_ios<_Elem,_Traits>::basic_ios' : cannot access private member declared in class 'std::basic_ios<_Elem,_Traits>'
<p>Getting this error and I'm pretty sure it's in the operator&lt;&lt; function. Both prints are public.</p>

<pre><code>void CRational::print() const
{
    print(cout);
}

void CRational::print(ostream &amp; sout) const
{
    if(m_denominator == 1)
        cout &lt;&lt; m_numerator;
    else
        cout &lt;&lt; m_numerator &lt;&lt; "/" &lt;&lt; m_denominator;
}

ostream operator&lt;&lt;(ostream &amp; sout,const CRational a)
{
    a.print();

    return sout;
}

CRational operator++() // prefix ++x
{
    m_numerator += m_denominator;
    return *this;
}

in main:
cout &lt;&lt; "e before: " &lt;&lt; e &lt;&lt; ", \"cout &lt;&lt; ++e\" : " &lt;&lt; ++e &lt;&lt; " after: " &lt;&lt; e &lt;&lt; endl; 
</code></pre>
