title: Cannot access private member declared in class 'std::basic_ios<_Elem,_Traits>'
body: <p>Having an issue with this particular method and not sure how to resolve it! The error I'm getting is the above:</p>
  
  <blockquote>
    <p>"error C2248: 'std::basic_ios&lt;_Elem,_Traits>::basic_ios' : cannot
    access private member declared in class
    'std::basic_ios&lt;_Elem,_Traits>'   C:\Program Files\Microsoft Visual
    Studio 10.0\VC\include\ostream    604"</p>
  </blockquote>
  
  <p>My method is:</p>
  
  <pre><code>ostream operator&lt;&lt;( ostream &amp; stream, ProcessClass const &amp; rhs )
  {
    stream &lt;&lt; rhs.name_;
    return stream;
  }
  </code></pre>
  
  <p>And in the header:</p>
  
  <pre><code>friend std::ostream operator&lt;&lt;( std::ostream &amp; stream, ProcessClass const &amp; rhs );
  </code></pre>
  
  <p>Any ideas on how to resolve this? I think it is something to do with passing by reference instead of value... but I'm a bit confused!</p>