title: error: base operand of ‘->’ has non-pointer type ‘const’
body: <p>I'm writing a c++ linked list using ostream operator, and I am stuck.
  What have I done wrong?</p>
  
  <pre><code>// Train class
  class Car{
      public:
          void print(ostream&amp;) const;
          friend std::ostream &amp;operator&lt;&lt;(std::ostream&amp;, const Car&amp;);
  };
  
  void Car::print(ostream&amp; out) const{
          out &lt;&lt; "OK" &lt;&lt; endl;
   }
  
  ostream&amp; operator&lt;&lt;(ostream&amp; os, const Car&amp; car){
      os &lt;&lt; car-&gt;print(os);
      return os;
  }
  </code></pre>
  
  <p><strong>error</strong>: base operand of ‘->’ has non-pointer type ‘const Car’<br>
  make: ***[Car.o] Error 1</p>
  
  <p>Things I have tried:<br>
  1) os &lt;&lt; car->print(*os);<br>
  2) os &lt;&lt; car.print(os); // it gets worse</p>