In what state should my overridden >> operator leave my object when the input stream contains invalid data?
<p>Say I have overridden the >> operator for a class like below:</p>

<pre><code>friend istream&amp; operator&gt;&gt;(istream&amp; in, MyObject&amp; obj)
{
    ...
    if (in.fail())
        // What do I do here?  Should obj be returned unmodified?
    ...
}
</code></pre>

<p>and say that the input stream is in a fail state because the data there means that I cannot get a valid MyObject out of it.  How should I leave the obj object? </p>
