Ok to use std::getline() with a moved-from std::string?
问题 Is it safe and well-defined for the second argument to std::getline(std::istream&, std::string&) to be an lvalue referring to a moved-from std::string, and, if so, is that string restored from its moved-from state, so methods such as pop_back() can be safely invoked? Put more simply, does writing to a string with getline() have equivalent semantics to assigning to that string? Or more concretely, is the following (somewhat contrived) snippet well-defined and correct? std::ifstream f("foo.txt"