//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is dual licensed under the MIT and the University of Illinois Open // Source Licenses. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // template // basic_istream& // getline(basic_istream&& is, // basic_string& str, charT delim); #include #include #include #include "min_allocator.h" int main() { #ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES { std::string s("initial text"); getline(std::istringstream(" abc* def* ghij"), s, '*'); assert(s == " abc"); } { std::wstring s(L"initial text"); getline(std::wistringstream(L" abc* def* ghij"), s, L'*'); assert(s == L" abc"); } #if __cplusplus >= 201103L { typedef std::basic_string, min_allocator> S; S s("initial text"); getline(std::istringstream(" abc* def* ghij"), s, '*'); assert(s == " abc"); } { typedef std::basic_string, min_allocator> S; S s(L"initial text"); getline(std::wistringstream(L" abc* def* ghij"), s, L'*'); assert(s == L" abc"); } #endif #endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES }