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 int main(int, char**) 20 { 21 { 22 std::stringbuf buf1("testing"); 23 std::stringbuf buf(move(buf1)); 24 assert(buf.str() == "testing"); 25 } 26 { 27 std::stringbuf buf1("testing", std::ios_base::in); 28 std::stringbuf buf(move(buf1)); 29 assert(buf.str() == "testing"); 30 } 31 { 32 std::stringbuf buf1("testing", std::ios_base::out); 33 std::stringbuf buf(move(buf1)); 34 assert(buf.str() == "testing"); 35 } 36 { 37 std::wstringbuf buf1(L"testing"); 38 std::wstringbuf buf(move(buf1)); 39 assert(buf.str() == L"testing"); 40 } 41 { 42 std::wstringbuf buf1(L"testing", std::ios_base::in); 43 std::wstringbuf buf(move(buf1)); 44 assert(buf.str() == L"testing"); 45 } 46 { 47 std::wstringbuf buf1(L"testing", std::ios_base::out); 48 std::wstringbuf buf(move(buf1)); 49 assert(buf.str() == L"testing"); 50 } 51 52 return 0; 53 } 54