| I/O manipulators | ||||
| Print functions(C++23) | ||||
| C-style I/O | ||||
| Buffers | ||||
(C++23) | ||||
(C++98/26*) | ||||
(C++20) | ||||
| Streams | ||||
| Abstractions | ||||
| File I/O | ||||
| String I/O | ||||
| Array I/O | ||||
(C++23) | ||||
(C++23) | ||||
(C++23) | ||||
(C++98/26*) | ||||
(C++98/26*) | ||||
(C++98/26*) | ||||
| Synchronized Output | ||||
(C++20) | ||||
| Types | ||||
| Error category interface | ||||
(C++11) | ||||
(C++11) |
| Public member functions | ||||
basic_stringbuf::operator= (C++11) | ||||
(C++11) | ||||
(C++20) | ||||
| Protected member functions | ||||
| Non-member functions | ||||
(C++11) | ||||
| Exposition-only member functions | ||||
std::basic_stringbuf& operator=(std::basic_stringbuf&& rhs); | (1) | (since C++11) |
std::basic_stringbuf& operator=(conststd::basic_stringbuf& rhs)= delete; | (2) | |
Contents |
| rhs | - | anotherbasic_stringbuf that will be moved from |
*this
#include <iostream>#include <sstream>#include <string> int main(){std::istringstream one("one");std::ostringstream two("two"); std::cout<<"Before move, one =\""<< one.str()<<'"'<<" two =\""<< two.str()<<"\"\n"; *one.rdbuf()= std::move(*two.rdbuf()); std::cout<<"After move, one =\""<< one.str()<<'"'<<" two =\""<< two.str()<<"\"\n";}
Output:
Before move, one = "one" two = "two"After move, one = "two" two = ""
constructs abasic_stringbuf object(public member function)[edit] |