title: operator<< and std::stringstream reference?
body: <p>I have a class that holds a reference to a stringstream (used as an overall application log). How do I add text to the referenced stringstream?</p>
  
  <p>An example (as I cannot post actual source here...)<br>
  main</p>
  
  <pre><code>stringstream appLog;
  RandomClass myClass;
  .....
  myClass.storeLog(&amp;applog);
  myClass.addText("Hello World");
  cout &lt;&lt; appLog.str().c_str() &lt;&lt; endl;
  </code></pre>
  
  <p>RandomClass cpp</p>
  
  <pre><code>void RandomClass::storeLog(stringstream *appLog)
  {
    m_refLog = appLog;
  }
  
  void RandomClass::addText(const char text[])
  {
    m_refLog &lt;&lt; text;    //help here...?
  }
  </code></pre>
  
  <p>I'm getting the following error in my real app using a very similar setup and method structure as above.
  <code>error C2296: '&lt;&lt;' : illegal, left operand has type 'std::stringstream *'</code><br>
  <code>error C2297: '&lt;&lt;' : illegal, right operand has type 'const char [11]'</code></p>
  
  <p>I know the error is because i'm using a reference and still trying to do '&lt;&lt;', but how else am I to do it?  <code>m_refLog-&gt;&lt;&lt;</code>???</p>