title: Check if ostream object is cout or ofstream, c++
body: <p>Is there a way in C++ to check if an <code>ostream</code> object is <code>cout</code> or a <code>ofstream</code> object?  </p>
  
  <p>Something like:
  <pre><code>ostream&amp; output(ostream&amp; out)
  {
      if (out == cout)
          return out;
      else
      {
          out &lt;&lt; "something different because its not going to the console" &lt;&lt; endl;
          return out;
      }
  }</pre></code></p>
  
  <p>The reason I want to do this, is that I want to overload the <code>&lt;&lt;</code> operator to do two different things depending on what type of stream it is used with.</p>
  
  <p>Is it possible to just overload the <code>&lt;&lt;</code> operator twice each time with a different type of stream?</p>
  
  <p>Updated to reflect intention better.</p>