title: checking for eof in string::getline
body: <p>How do I check for end-of-file using the <code>std::getline</code> function? If I use <code>eof()</code> it won't signal <code>eof</code> until I attempt to read beyond end-of-file.</p>