# std::basic_streambuf<CharT,Traits>::swap

> C++ Atlas: `cppatlas.com/w/cpp/io/basic_streambuf/swap` | Source: https://en.cppreference.com/w/cpp/io/basic_streambuf/swap | Domain: Input/output | Standards: C++11

Exchanges the contents of the stream buffer with those of other.

## Official Specification Summary (cppreference)

```cpp
void swap( basic_streambuf& other ); // (since C++11)
```

Exchanges the contents of the stream buffer with those of `other`.

### Parameters

- `other` - stream buffer to exchange contents with

### Return value

(none)

### Exceptions

May throw implementation-defined exceptions.

### Example

> Note: This section is incomplete Reason: no example

---
Attribution: content from https://en.cppreference.com/w/cpp/io/basic_streambuf/swap (cppreference.com), licensed under CC-BY-SA 3.0 and GFDL. Modified: converted to markdown, study notes added. Offline snapshot of 9 February 2025.