std::basic_iostream<CharT,Traits>:: swap
From cppreference.net
<
cpp
|
io
|
basic iostream
C++
Input/output library
| 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)
|
std::basic_iostream
| Member functions | ||||
| Protected member functions | ||||
|
basic_iostream::swap
|
|
protected
:
void swap ( basic_iostream & other ) ; |
(自 C++11 起) | |
与另一个输入/输出流对象交换状态。实际上调用 basic_istream < CharT,Traits > :: swap ( other ) 。
此成员函数受保护:由派生流类 std::basic_stringstream 和 std::basic_fstream 的 swap 成员函数调用,这些派生类知道如何正确交换关联的流缓冲区。
参数
| 其他 | - | 用于交换状态的另一个流 |
返回值
* this