title: C++ std::stringstream operator<< overloading
body: <p>I have the following class(prototipe):</p>
  
  <pre><code>class Token
  {
  public:
      //members, etc.
      friend std::stringstream&amp; operator&lt;&lt; (std::stringstream &amp;out, Token &amp;t);
  };
  </code></pre>
  
  <p>And the operator is implemented like this:</p>
  
  <pre><code>std::stringstream &amp; operator&lt;&lt; (std::stringstream &amp;out, Token &amp;t)
  {
      out &lt;&lt; t.getValue(); //class public method
      return out;
  }
  </code></pre>
  
  <p>Now, I'm trying to use it like this:</p>
  
  <pre><code>std::stringstream out;
  Token t;
  //initialization, etc.
  
  out &lt;&lt; t;
  </code></pre>
  
  <p>And VS gives me error, saying that there is no match for &lt;&lt; operator. What am I wrong in?</p>