blob: 75d22ac87979aebb94fe728212e6f1aa59712ff6 [file] [log] [blame]
Howard Hinnant3e519522010-05-11 19:42:16 +00001//===----------------------------------------------------------------------===//
2//
Howard Hinnant5b08a8a2010-05-11 21:36:01 +00003// The LLVM Compiler Infrastructure
Howard Hinnant3e519522010-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// <sstream>
11
12// template <class charT, class traits = char_traits<charT>, class Allocator = allocator<charT> >
13// class basic_ostringstream
14
15// basic_ostringstream(basic_ostringstream&& rhs);
16
17#include <sstream>
18#include <cassert>
19
20int main()
21{
22#ifdef _LIBCPP_MOVE
23 {
24 std::ostringstream ss0(" 123 456");
25 std::ostringstream ss(std::move(ss0));
26 assert(ss.rdbuf() != 0);
27 assert(ss.good());
28 assert(ss.str() == " 123 456");
29 int i = 234;
30 ss << i << ' ' << 567;;
31 assert(ss.str() == "234 5676");
32 }
33 {
34 std::wostringstream ss0(L" 123 456");
35 std::wostringstream ss(std::move(ss0));
36 assert(ss.rdbuf() != 0);
37 assert(ss.good());
38 assert(ss.str() == L" 123 456");
39 int i = 234;
40 ss << i << ' ' << 567;;
41 assert(ss.str() == L"234 5676");
42 }
Howard Hinnant66dbf0d2010-08-22 00:26:48 +000043#endif // _LIBCPP_MOVE
Howard Hinnant3e519522010-05-11 19:42:16 +000044}