std::basic_ios<CharT,Traits>:: swap
From cppreference.net
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_ios
| Member functions | ||||
| State functions | ||||
| Formatting | ||||
| Miscellaneous | ||||
| Protected member functions | ||||
|
(C++11)
|
||||
|
basic_ios::swap
(C++11)
|
||||
|
(C++11)
|
|
protected
:
void swap ( basic_ios & other ) noexcept ; |
(自 C++11 起) | |
交换
*
this
与
other
的状态,但不包括关联的
rdbuf
对象。
rdbuf()
和
other.
rdbuf
(
)
返回的值与调用前相同。
此 swap 函数受保护:它由派生流类(如 std::basic_ofstream 或 std::basic_istringstream )的 swap 成员函数调用,这些派生类知道如何正确交换关联的流缓冲区。
参数
| 其他 | - |
用于交换状态的
basic_ios
对象
|
参见
|
(C++11)
|
从另一个
std::basic_ios
移动(除
rdbuf
外)
(受保护成员函数) |