title: Read from cin or a file
body: <p>When I try to compile the code</p>
  
  <pre><code>istream in;
  if (argc==1)
          in=cin;
  else
  {
          ifstream ifn(argv[1]);
          in=ifn;
  }
  </code></pre>
  
  <p>gcc fails, complaining that <code>operator=</code> is private.  Is there any way to set an <code>istream</code> to different values based on a condition?</p>