<beman/optional/optional.hpp>
constexpr
void
swap(optional& rhs) noexcept(std::is_nothrow_move_constructible<T>::value && std::is_nothrow_swappable<T>::value);
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.
Name | Description |
---|---|
rhs |