If any exception is thrown, the result of the expression
this->has_value() remains unchanged
. If an exception is thrown during the call to
T's move constructor,
the state of
rhs.val is determined by the exception safety guarantee of
T's move constructor
. If an exception is thrown during the call to
T's move assignment,
the states of
val and
rhs.val are determined by the exception safety guarantee of
T's move assignment
. If
is_trivially_move_constructible_v<T> &&
is_trivially_move_assignable_v<T> &&
is_trivially_destructible_v<T> is
true,
this assignment operator is trivial
.