//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // template // basic_istream& // getline(basic_istream& is, // basic_string& str); #include #include #include int main() { { std::istringstream in(" abc\n def\n ghij"); std::string s("initial text"); getline(in, s); assert(in.good()); assert(s == " abc"); getline(in, s); assert(in.good()); assert(s == " def"); getline(in, s); assert(in.eof()); assert(s == " ghij"); } { std::wistringstream in(L" abc\n def\n ghij"); std::wstring s(L"initial text"); getline(in, s); assert(in.good()); assert(s == L" abc"); getline(in, s); assert(in.good()); assert(s == L" def"); getline(in, s); assert(in.eof()); assert(s == L" ghij"); } }