```
variant& operator=(const variant& rhs);
```

Effects:

- Otherwise, if *this holds a value but rhs does not, destroys the value contained in *this and sets *this to not hold a value.
- Otherwise, if either is_nothrow_copy_constructible_v<T> is true or is_nothrow_move_constructible_v<T> is false, equivalent to emplace<j>(get<j>(rhs)).
- Otherwise, equivalent to operator=(variant(rhs)).

```
variant& operator=(variant&& rhs) noexcept(see below);
```

Effects:

Remarks:
This function shall not participate in overload resolution unless
is_move_constructible_v<T> && is_move_assignable_v<T> is
true for all i.

The expression inside noexcept is equivalent to:
is_nothrow_move_constructible_v<T> && is_nothrow_move_assignable_v<T> for all i.

- If an exception is thrown during the call to T's move construction (with j being rhs.index()), the variant will hold no value.
- If an exception is thrown during the call to T's move assignment, the state of the contained value is as defined by the exception safety guarantee of T's move assignment; index() will be j.

```
template<class T> variant& operator=(T&& t) noexcept(see below);
```

Effects:

Remarks:
This function shall not participate in overload resolution unless

- is_same_v<remove_cvref_t<T>, variant> is false,
- is_assignable_v<T&, T> && is_constructible_v<T, T> is true, and
- the expression FUN(std::forward<T>(t)) (with FUN being the above-mentioned set of imaginary functions) is well-formed.

The expression inside noexcept is equivalent to:

is_nothrow_assignable_v<T&, T> && is_nothrow_constructible_v<T, T>

- If an exception is thrown during the assignment of std::forward<T>(t) to the value contained in *this, the state of the contained value and t are as defined by the exception safety guarantee of the assignment expression; valueless_by_exception() will be false.
- If an exception is thrown during the initialization of the contained value, the variant object might not hold a value.