title: Is private within this context? Trying to overload << operator
body: <pre><code>#include &lt;cctype&gt;
  #include &lt;deque&gt;
  #include &lt;iostream&gt;
  #include &lt;string&gt;
  #include &lt;vector&gt;
  #include &lt;iomanip&gt;
  #include &lt;list&gt;
  #include &lt;limits&gt;
  
  class Song {
      friend std::ostream &amp;os(std::ostream &amp;os, const Song &amp;s);
      std::string name;
      std::string artist;
      int rating;
  public:
      Song() = default;
      Song(std::string name, std::string artist, int rating) 
          : name{name}, artist{artist}, rating{rating} {}
      std::string get_name() const {
          return name;
      }
  
      std::string get_artist() const {
          return artist;
      }
  
      int get_rating() const {
          return rating;
      }
  
      bool operator&lt;(const Song &amp;rhs) const {
          return this-&gt;name &lt; rhs.name;
      }
  
      bool operator==(const Song &amp;rhs) const {
          return this-&gt;name == rhs.name;
      }
  };
  
  std::ostream &amp;operator&lt;&lt;(std::ostream &amp;os, const Song &amp;s){
      os &lt;&lt; std::setw(20) &lt;&lt; std::left &lt;&lt; s.name
          &lt;&lt; std::setw(30) &lt;&lt; std::left &lt;&lt; s.artist
          &lt;&lt; std::setw(2) &lt;&lt; std::left &lt;&lt; s.rating;
          return os;
  }
  </code></pre>
  
  <p>I am getting the error Song::name is private within this context, but I did not make it private. The std::stream &amp;operator above me with the formatted output is the one I am having trouble with. </p>