One thing I'm not pretty sure after googling for a while, is the returned string of getline(). Hope to get it confirmed here.
std::getline
This global version returns a std::string so it's not necessarily null-terminated. Some compilers may append a '\0' while the others won't.
std::istream::getline
This function returns a c-style string so it's guaranteed that the string is null-terminated.
Is that right?