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