blob: 937fb73ffd16eb463efbeab7fbfeec0acc523984 [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_stringbuf
14
15// basic_stringbuf(basic_stringbuf&& rhs);
16
17#include <sstream>
18#include <cassert>
19
20int main()
21{
22 {
23 std::stringbuf buf1("testing");
24 std::stringbuf buf(move(buf1));
25 assert(buf.str() == "testing");
26 }
27 {
28 std::stringbuf buf1("testing", std::ios_base::in);
29 std::stringbuf buf(move(buf1));
30 assert(buf.str() == "testing");
31 }
32 {
33 std::stringbuf buf1("testing", std::ios_base::out);
34 std::stringbuf buf(move(buf1));
35 assert(buf.str() == "testing");
36 }
37 {
38 std::wstringbuf buf1(L"testing");
39 std::wstringbuf buf(move(buf1));
40 assert(buf.str() == L"testing");
41 }
42 {
43 std::wstringbuf buf1(L"testing", std::ios_base::in);
44 std::wstringbuf buf(move(buf1));
45 assert(buf.str() == L"testing");
46 }
47 {
48 std::wstringbuf buf1(L"testing", std::ios_base::out);
49 std::wstringbuf buf(move(buf1));
50 assert(buf.str() == L"testing");
51 }
52}