cpp/utility/expected/swap

Swaps the contents with those of.


 * If both and  are true:
 * If is (possibly cv-qualified), no effects.
 * Otherwise, equivalent to.


 * If both and  are false, equivalent to.
 * If is false and  is true, calls.
 * If is true and  is false,
 * If is (possibly cv-qualified), let unex be the member that represents the unexpected value, equivalent to:


 * Otherwise, let val be the member that represents the expected value and unex be the member that represents the unexpected value, equivalent to:


 * In either case, if no exception was thrown, after swap, is false, and  is true.

This function participates in overload resolution only if


 * either is (possibly cv-qualified), or  is true, and
 * is true, and
 * either is (possibly cv-qualified), or  is true, and
 * is true, and
 * at least one of the following is true:
 * is (possibly cv-qualified)

Return value
(none)

Exceptions
If is (possibly cv-qualified) ,

Otherwise,

In the case of thrown exception, the states of the contained values of and  are determined by the exception safety guarantees of  or 's and 's move constructor, whichever is called. For both and, if the object contained an expected value, it is left containing an expected value, and the other way round.