1//===----------------------------------------------------------------------===//
2//
3//                     The LLVM Compiler Infrastructure
4//
5// This file is dual licensed under the MIT and the University of Illinois Open
6// Source Licenses. 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}
53