Swaps this optional with the other.

Synopsis

Declared in <beman/optional/optional.hpp>

constexpr
void
swap(optional& rhs) noexcept(std::is_nothrow_move_constructible<T>::value && std::is_nothrow_swappable<T>::value);

Description

Swaps this optional with the other.

If neither optionals have a value, nothing happens. If both have a value, the values are swapped. If one has a value, it is moved to the other and the movee is left valueless.

Parameters

Name

Description

rhs

Created with MrDocs