# std::filesystem::path::swap

> C++ Atlas: `cppatlas.com/w/cpp/filesystem/path/swap` | Source: https://en.cppreference.com/w/cpp/filesystem/path/swap | Domain: Filesystem | Standards: C++17

Swaps the contents (both native and generic format) of *this and other.

## Official Specification Summary (cppreference)

```cpp
void swap( path& other ) noexcept; // (1) (since C++17)
```

Swaps the contents (both native and generic format) of `*this` and `other`.

### Parameters

- `other` - another path to exchange the contents with

### Return value

(none)

### Complexity

Constant.

### See also

- [`swap(std::filesystem::path)`](https://en.cppreference.com/w/cpp/filesystem/path/swap2) (C++17): specializes the `std::swap` algorithm (function)

---
Attribution: content from https://en.cppreference.com/w/cpp/filesystem/path/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.