title: String being empty still gives True value
body: <p>The code is used to implement Max-Heaps using Binary Heaps, and the output is instead 1000 unwanted lines.</p>
  <pre><code>auto input = ifstream(filename);
  string line;
  getline(input,line);
  while(!line.empty())
  {
      int option;
      int in;
      stringstream l(line);
      l &gt;&gt; in;
      option = in;
      switch (option)
      {
          case 0:
          {
              cout &lt;&lt; getMax() &lt;&lt; &quot;\n&quot;;
              break;
          }
          case 1:
          {
              while(l &gt;&gt; in)
              {
                  insert(in);
              }
              break;
          }
          case 2:
          {
              cout &lt;&lt; extractMax() &lt;&lt; &quot;\n&quot;;
              break;
          }
          case 3:
          {
              filled = -1;
              while(l &gt;&gt; in)
              {
                  insert(in);
              }
              break;
          }
      }
      getline(input,line);
  }
  </code></pre>
  <p>The input value of the File is:</p>
  <pre><code>1 6 2 8 12 3 7
  0
  2
  2
  0
  1 11
  0
  3 5 15 12 7 9 13 35
  2
  2
  2
  </code></pre>
  <p>Upon debugging, the while condition <code>(!line.empty())</code> returns a true value after the file is over. I have tried replacing it with `(line != &quot;\n&quot;), but the error persists. What could be the cause of the error?</p>