• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 //===----------------------------------------------------------------------===//
2 //
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6 //
7 //===----------------------------------------------------------------------===//
8 
9 // <sstream>
10 
11 // template <class charT, class traits = char_traits<charT>, class Allocator = allocator<charT> >
12 // class basic_stringbuf
13 
14 // basic_stringbuf(basic_stringbuf&& rhs);
15 
16 #include <sstream>
17 #include <cassert>
18 
19 #include "test_macros.h"
20 
main(int,char **)21 int main(int, char**)
22 {
23     {
24         std::stringbuf buf1("testing");
25         std::stringbuf buf(move(buf1));
26         assert(buf.str() == "testing");
27     }
28     {
29         std::stringbuf buf1("testing", std::ios_base::in);
30         std::stringbuf buf(move(buf1));
31         assert(buf.str() == "testing");
32     }
33     {
34         std::stringbuf buf1("testing", std::ios_base::out);
35         std::stringbuf buf(move(buf1));
36         assert(buf.str() == "testing");
37     }
38     {
39         std::wstringbuf buf1(L"testing");
40         std::wstringbuf buf(move(buf1));
41         assert(buf.str() == L"testing");
42     }
43     {
44         std::wstringbuf buf1(L"testing", std::ios_base::in);
45         std::wstringbuf buf(move(buf1));
46         assert(buf.str() == L"testing");
47     }
48     {
49         std::wstringbuf buf1(L"testing", std::ios_base::out);
50         std::wstringbuf buf(move(buf1));
51         assert(buf.str() == L"testing");
52     }
53 
54   return 0;
55 }
56