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