blob: a7e0ad358f05d1708a6c4a0393cdda6b057ebd34 [file] [log] [blame]
Howard Hinnantbc8d3f92010-05-11 19:42:16 +00001//===----------------------------------------------------------------------===//
2//
Howard Hinnantf5256e12010-05-11 21:36:01 +00003// The LLVM Compiler Infrastructure
Howard Hinnantbc8d3f92010-05-11 19:42:16 +00004//
5// This file is distributed under the University of Illinois Open Source
6// License. See LICENSE.TXT for details.
7//
8//===----------------------------------------------------------------------===//
9
10// <string>
11
12// template<class charT, class traits, class Allocator>
13// basic_istream<charT,traits>&
14// getline(basic_istream<charT,traits>&& is,
15// basic_string<charT,traits,Allocator>& str, charT delim);
16
17#include <string>
18#include <sstream>
19#include <cassert>
20
21int main()
22{
Howard Hinnant73d21a42010-09-04 23:28:19 +000023#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
Howard Hinnantbc8d3f92010-05-11 19:42:16 +000024 {
25 std::string s("initial text");
26 getline(std::istringstream(" abc* def* ghij"), s, '*');
27 assert(s == " abc");
28 }
29 {
30 std::wstring s(L"initial text");
31 getline(std::wistringstream(L" abc* def* ghij"), s, L'*');
32 assert(s == L" abc");
33 }
Howard Hinnant73d21a42010-09-04 23:28:19 +000034#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
Howard Hinnantbc8d3f92010-05-11 19:42:16 +000035}