# std::experimental::filesystem::swap(std::experimental::filesystem::path)

> C++ Atlas: `cppatlas.com/w/cpp/experimental/fs/path/swap2` | Source: https://en.cppreference.com/w/cpp/experimental/fs/path/swap2 | Domain: Technical specifications

Exchanges the state of lhs with that of rhs. Effectively calls lhs.swap(rhs).

## Official Specification Summary (cppreference)

```cpp
void swap( path& lhs, path& rhs ); // (filesystem TS)
```

Exchanges the state of `lhs` with that of `rhs`. Effectively calls `lhs.swap(rhs)`.

### Parameters

- `lhs, rhs` - paths whose states to swap

### Return value

(none)

### Exceptions

`noexcept` specification:

`noexcept`

### See also

- [`swap`](https://en.cppreference.com/w/cpp/experimental/fs/path/swap): swaps two paths (public member function)

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