Replace the contents of the specified str string by extracting characters from the specified is stream until a newline character (`is.widen('
')) is extracted, and return is`. The newline character is removed from the input stream but is not appended to str. If an eof is detected before the newline, then the characters up to the eof are put into str and is.eof() becomes true. If is.good() is false on entry, then do nothing, otherwise if no characters are extracted (e.g., because because the stream is at eof), str will become empty and is.fail() will become true.
Declared in <bslstl_string.h>
template<
class CHAR_TYPE,
class CHAR_TRAITS,
class ALLOCATOR>
std::basic_istream<CHAR_TYPE, CHAR_TRAITS>&
getline(
std::basic_istream<CHAR_TYPE, CHAR_TRAITS>& is,
basic_string<CHAR_TYPE, CHAR_TRAITS, ALLOCATOR>& str);