title: 'std::ios_base::ios_base(const std::ios_base&)’ is private' error while overloading operator<< for std::ostram
body: <p>I've got a struct which looks like this:</p>
  
  <pre><code>sturct person
  {
      string surname;
      person(string n) : surname(n) {};
  }
  </code></pre>
  
  <p>I need to overload <code>operator&lt;&lt;</code> for <code>std::ostream</code> and <code>person</code>. I wrote this function:</p>
  
  <pre><code>std::ostream operator&lt;&lt;(std::ostream &amp; s, person &amp; os)
  {
      s &lt;&lt; os.surname;
      return s;
  }
  </code></pre>
  
  <p>but I receive this errors:</p>
  
  <blockquote>
    <p>/usr/include/c++/4.6/bits/ios_base.h|788|error: ‘std::ios_base::ios_base(const std::ios_base&amp;)’ is private|</p>
    
    <p>/usr/include/c++/4.6/bits/basic_ios.h|64|error: within this context</p>
    
    <p>/usr/include/c++/4.6/ostream|57|note: synthesized method ‘std::basic_ios::basic_ios(const std::basic_ios&amp;)’ first required here |</p>
  </blockquote>