title: std::ifstream initialization with filename
body: <p>I am using the following piece of code to check whether file is existing or not using <code>std::ifstream</code>.</p>
  
  <pre><code>#include &lt;iostream&gt;
  #include &lt;fstream&gt;
  
  int main()
  {
      if (std::ifstream("file.txt"))
      {
          std::cout &lt;&lt; "File present\n";
      }
  
      return 0;
  }
  </code></pre>
  
  <p>Since I am not using any object for <code>std::ifstream</code>, how do I close the file? Or is it not required to call close?</p>