# std::experimental::swap(std::experimental::any)

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

Swaps the content of two any objects. Calls lhs.swap(rhs).

## Official Specification Summary (cppreference)

```cpp
void swap(any& lhs, any& rhs) noexcept; // (library fundamentals TS)
```

Swaps the content of two `any` objects. Calls `lhs.swap(rhs)`.

### Parameters

- `lhs, rhs` - objects to swap

### Return value

(none)

### See also

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

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