title: C++ How to differentiate std::cin to std::ifstream?
body: <p>I am trying to make a simple comparison to find if istream is a std::cin or std::ifstream.</p>
  
  <p>My pseudocode is something like that:</p>
  
  <pre><code>class myclass
  {
  public:
      void write(istream&amp; is)
      {
          if(is == cin) // this does not work
          {
              //do something
          }
          else
          {
              //do something else
          }
      }     
  };
  </code></pre>
  
  <p>How can I proceed?</p>
  
  <p>Thank you!</p>