title: ifstream: check if opened successfully
body: <p>A colleague just told me that this code:</p>
  
  <pre><code>std::ifstream stream(filename.c_str());
  if (!stream)
  {
      throw std::runtime_error("..");
  }
  </code></pre>
  
  <p>would be wrong. He said <code>ifstream</code> evaluates to 0 if opening is successful. My code works, but I wanted to find the documentation but didn't see where it says how to check if opening was successful. Can you point me to it?</p>